<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:admin="http://webns.net/mvcb/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:content="http://purl.org/rss/1.0/modules/content/">

    <channel>
    
    <title>Glen Swinfield | Expression Engine Feed</title>
    <link>http://www.glenswinfield.co.uk/</link>
    <description>Expression Engine plugins, modules hacks and extensions</description>
    <dc:language>en</dc:language>
    <dc:creator>glen@glenswinfield.co.uk</dc:creator>
    <dc:rights>Copyright 2008</dc:rights>
    <dc:date>2008-09-28T13:54:00+00:00</dc:date>
    <admin:generatorAgent rdf:resource="http://expressionengine.com/" />
    

    <item>
      <title>ExpressionEngine Text Plugin</title>
      <link>http://www.glenswinfield.co.uk/activity/comment/expressionengine_text_plugin/</link>
      <guid>http://www.glenswinfield.co.uk/activity/comment/expressionengine_text_plugin/#When:08:36:00Z</guid>
      <description>A while ago I posted a plugin that truncated text in ExpressionEngine without breaking words &#45; it removed html, wrapped it in a specified tag and added some optional link text on the end.


It was posted in a hurry and as ever, this resulted in it being a bit buggy and a bit tricky for me to maintain. I have decided to change direction and create a &#8216;text&#8217; plugin around it that does the same job, but better, and allows for the addition of other &#8216;text&#8217; helper functions in the same plugin. We&#8217;re using it at Erskine, and it seems to be working just fine.


The name of the plugin has changed so if you want to upgrade you will need to edit your templates. I will only be maintaining this version of the plugin from now on. Sorry if this causes a bit of inconvenience, but it&#8217;s for the best. Honest.

Usage

To take a block of text and display it, truncated to 100 characters (to the nearest word) with a read more link on the end, wrapped in a list item with a class of &#8216;summary&#8217;, you do this:



&#123;exp:gms_text:truncate&amp;nbsp;wrapper=&quot;li&quot;&amp;nbsp;wrapper_class=&quot;summary&quot;&amp;nbsp;end_url=&quot;&#123;url_title&#125;&quot;&amp;nbsp;end_text=&quot;Read&amp;nbsp;in&amp;nbsp;full&amp;nbsp;...&quot;&amp;nbsp;char_limit=&quot;100&quot;&#125;&#123;big_long_text&#125;&#123;/exp:gms_text:truncate&#125;</description>
      <dc:subject>ExpressionEngine, Downloads</dc:subject>
      <dc:date>2008-09-24T08:36:00+00:00</dc:date>
    </item>

    <item>
      <title>Better ExpressionEngine Related Entries</title>
      <link>http://www.glenswinfield.co.uk/activity/comment/better_expressionengine_related_entries/</link>
      <guid>http://www.glenswinfield.co.uk/activity/comment/better_expressionengine_related_entries/#When:21:37:00Z</guid>
      <description>Basically, having information interrelated is fundamental to all but the simplest of site, and it has always seemed ridiculous that related entries provision in EE 1.6.x is a bit token. It doesn&#8217;t really offer you much flexibility or functionality, especially for &#8216;forward&#8217; related entries. This extension (and hack) will allow you to use the usual weblog:entries tag, with a parent or child, url_title or id parameter to get related entries with all the gubbins you would usually get from the weblog:entries tag.

How it works
Basically we&#8217;ve got an extension that intercepts the template parsing process and inserts a pipe separated string of related entry_id&#8217;s into the tag parameters. So as far as EE is concerned you specified the id&#8217;s yourself in the template. Only you didn&#8217;t, the extension did it for you.

The problem
There is no hook in the template class that allows us to implement our extension where we need to, so wee need to add one. This is the only hack required, and it is very simple. Basically go to /core/template.php and around line 762 you will see some code like this:



$args&amp;nbsp;&amp;nbsp;=&amp;nbsp;$FNS&#45;&amp;gt;assign_parameters($args);



Just after this we need to add a custom hook, so paste/type this code in:



//&amp;nbsp;hack&#45;hack&#45;hackif&amp;nbsp;(isset($EXT&#45;&amp;gt;extensions&#91;&apos;parse_template_assign_params&apos;&#93;))&#123;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$args&amp;nbsp;=&amp;nbsp;$EXT&#45;&amp;gt;call_extension(&apos;parse_template_assign_params&apos;,$args);&#125;



IMPORTANT UPDATE:

Sorry, forgot to mention that you need to make the $EXT global in the function &#8216;parse_template()&#8217; like this, props to Steve Sharpe at Gleam for the heads&#45;up:



function&amp;nbsp;parse_template()&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&#123;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;global&amp;nbsp;$FNS,&amp;nbsp;$EXT;



This hook is now available to the extension, so download and install it.

Usage

Basically you just use a normal weblog:entries tag, but you add one of four extra parameters:


parent_id=&quot;&#8221; ~ entry_id of parent entry
parent_url_title=&quot;&#8221; ~ url_title of parent entry
child_id=&quot;&#8221; (reverse)
child_url_title=&quot;&#8221; (reverse)

Example

If I wanted to get all weblog_entries in my cars weblog that were related to a specific manufacturer &#45; let&#8217;s imagine that {segment_3} is &#8216;Ford&#8217;&#8230;


&#123;exp:weblog:entries weblog=&quot;cars&quot; status=&quot;not Closed&#8221; parent_url_title=&quot;{segment_3&#125;&quot;}

{title} ~ {entry_date}

&#123;/exp:weblog:entries&#125;


Simple as that &#45; ALL weblog:entries functionality is available.

Disclaimer

There is obviously going to be extra pressure on the database using this method &#45; but I haven&#8217;t ran into any real issues with this and it is running on some large sites with less than accommodating servers. just mind how you go.</description>
      <dc:subject>ExpressionEngine, Downloads</dc:subject>
      <dc:date>2008-09-17T21:37:00+00:00</dc:date>
    </item>

    <item>
      <title>EE Youtube Video Embed Plugin</title>
      <link>http://www.glenswinfield.co.uk/activity/comment/ee_youtube_video_embed_plugin/</link>
      <guid>http://www.glenswinfield.co.uk/activity/comment/ee_youtube_video_embed_plugin/#When:00:20:00Z</guid>
      <description>Just pass it the YouTube ID or the full URL to the video and the width and height you want and it will return the code you need. Very easy. It has very few features, and that&#8217;s why I use it.

Example Use

&#123;exp:gms_youtube_embed&amp;nbsp;youtube_id=&quot;http://youtube.com/watch?v=MusyO7J2inM&quot;&amp;nbsp;width=&quot;200&quot;&amp;nbsp;height=&quot;100&quot;&#125;</description>
      <dc:subject>ExpressionEngine, Downloads</dc:subject>
      <dc:date>2008-03-08T00:20:00+00:00</dc:date>
    </item>

    <item>
      <title>Truncate Text Nicely in EE</title>
      <link>http://www.glenswinfield.co.uk/activity/comment/gms_truncator/</link>
      <guid>http://www.glenswinfield.co.uk/activity/comment/gms_truncator/#When:22:30:00Z</guid>
      <description>The text truncator has been updated and moved to here

&#45;&#45;&#45; You can ignore from this line down, it&apos;s not relevant anymore and is here for archive purposes only &#45;&#45;&#45;

Basically this plugin...


    Strips html tags from a text block, except for those specified in the parameters.
    Limits the text block to the specified number of characters at the nearest word &#45; no broken words.
    Wraps the whole thing in a specified html element (if required)
    Appends a string specified in the &apos;finish&apos; parameter to the end of the string.


I built this because I wanted to use it for some small text areas and couldn&apos;t find anything else that did what I wanted. It may or may not be of use to you. Feel free to recommend changes/improvements.

Example Use


&#123;exp:gms_truncator&amp;nbsp;finish=&quot;&amp;lt;a&amp;nbsp;href=&apos;/path/&#123;url_title&#125;&apos;&amp;gt;...&amp;lt;/a&amp;gt;&quot;&amp;nbsp;wrap_html=&quot;div&quot;&amp;nbsp;max=&quot;150&quot;&#125;&amp;lt;/strong&amp;gt;&amp;lt;br&amp;nbsp;/&amp;gt;&amp;lt;br&amp;nbsp;/&amp;gt;Lorem&amp;nbsp;Ipsum&amp;nbsp;is&amp;nbsp;simply&amp;nbsp;dummy&amp;nbsp;text&amp;nbsp;of&amp;nbsp;the&amp;nbsp;printing&amp;nbsp;and&amp;nbsp;typesetting&amp;nbsp;industry.&amp;nbsp;Lorem&amp;nbsp;Ipsum&amp;nbsp;has&amp;nbsp;been&amp;nbsp;the&amp;nbsp;industrys&amp;nbsp;standard&amp;nbsp;dummy&amp;nbsp;text&amp;nbsp;ever&amp;nbsp;since&amp;nbsp;the&amp;nbsp;1500s,&amp;nbsp;when&amp;nbsp;an&amp;nbsp;unknown&amp;nbsp;printer&amp;nbsp;took&amp;nbsp;a&amp;nbsp;galley&amp;nbsp;of&amp;nbsp;type&amp;nbsp;and&amp;nbsp;scrambled&amp;nbsp;it&amp;nbsp;to&amp;nbsp;make&amp;nbsp;a&amp;nbsp;type&amp;nbsp;specimen&amp;nbsp;book.&amp;nbsp;It&amp;nbsp;has&amp;nbsp;survived&amp;nbsp;not&amp;nbsp;only&amp;nbsp;five&amp;nbsp;centuries,&amp;nbsp;but&amp;nbsp;also&amp;nbsp;the&amp;nbsp;leap&amp;nbsp;into&amp;nbsp;electronic&amp;nbsp;typesetting,&amp;nbsp;remaining&amp;nbsp;essentially&amp;nbsp;unchanged.&amp;nbsp;It&amp;nbsp;was&amp;nbsp;popularised&amp;nbsp;in&amp;nbsp;the&amp;nbsp;1960s&amp;nbsp;with&amp;nbsp;the&amp;nbsp;release&amp;nbsp;of&amp;nbsp;Letraset&amp;nbsp;sheets&amp;nbsp;containing&amp;nbsp;Lorem&amp;nbsp;Ipsum&amp;nbsp;passages,&amp;nbsp;and&amp;nbsp;more&amp;nbsp;recently&amp;nbsp;with&amp;nbsp;desktop&amp;nbsp;publishing&amp;nbsp;software&amp;nbsp;like&amp;nbsp;Aldus&amp;nbsp;PageMaker&amp;nbsp;including&amp;nbsp;versions&amp;nbsp;of&amp;nbsp;Lorem&amp;nbsp;Ipsum.&amp;lt;br&amp;nbsp;/&amp;gt;&amp;lt;br&amp;nbsp;/&amp;gt;&amp;lt;strong&amp;gt;&#123;/exp:gms_truncator&#125;&amp;lt;/strong&amp;gt;


Would produce the following html:

&amp;lt;p&amp;gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry&apos;s standard dummy text ever since &amp;lt;a href=&quot;/path/the_url_title&quot;&amp;gt;...&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;</description>
      <dc:subject>ExpressionEngine</dc:subject>
      <dc:date>2008-03-06T22:30:00+00:00</dc:date>
    </item>

    
    </channel>
</rss>