Download EE 2 Docs Download EE 1 Docs
ExpressionEngine

2.8.1 User Guide

Using Plugins

ExpressionEngine is designed so that features can be added through the use of Plugins. A list of first party ExpressionEngine plugins can be found on EllisLab’s GitHub page, along with installation and usage instructions for each one. It is important to review the notes for the specific plugin you wish to use.

Installation

Follow these steps to install a plugin:

  1. Download the Plugin to your local computer. You’ll usually need to unzip the file.
  2. Upload the Plugin’s folder to your system/expressionengine/third_party/ folder.

For instance, the No Follow plugin would be placed like so:

  • system/expressionengine/third_party/no_follow/pi.no_follow.php

Once the Plugin is installed, you should be able to see it listed in the Plugin Manager in your ExpressionEngine Control Panel.

Note

Some Plugins may have additional installation requirements specific to that particular Plugin. Be sure to read any instructions, readme files, etc. that may come with the Plugin.

Basic Usage

Within your templates you’ll typically wrap the item you want affected by the plugin:

{exp:xml_encode}
        some content
{/exp:xml_encode}

In the above example, the content would be XML Encoded.

Nested Plugins

It is possible to nest Plugins in order for content to be affected by more than one plugin. For example, you can do this:

{exp:word_limit total="35"}
        {exp:xml_encode}
                some content
        {/exp:xml_encode}
{/exp:word_limit}

By default, ExpressionEngine will process the innermost Plugin first, then the next Plugin, and so on until all the plugins wrapping a given piece of content have been parsed. In the above example, the content is XML Encoded first and then the result of that is limited to 35 words.

Changing Parsing Order

You may change the parsing order and instruct ExpressionEngine to parse an outer Plugin first. This is done by adding a parse=”inward” parameter to the Plugin opening tag. Using that parameter will tell EE to parse that Plugin before parsing any Plugins inside of it.

parse="inward"

Examples

Here are some examples to help illustrate the parsing order.

{exp:magpie url="http://some-site.com" parse="inward"}
        {items}
                <a href="{link}">{title}</a><br />
                {exp:word_limit total="20"}
                        {content}
                {/exp:word_limit}<br />
        {/items}
{/exp:magpie}

With the above, the “magpie” Plugin will be parsed first. This will allow the content of the {content} variable to be available to the other, nested Plugin: “word_limit”.

Here is a much more complicated example that demonstrates both parsing orders in action.

{exp:magpie url="http://some-site.com" limit="15" refresh="720" parse="inward"}
        <ul>
                {items}
                        <li><a href="{link}">{title}</a><br />
                                {exp:word_limit total="35"}
                                        {exp:xml_encode}
                                                {content}
                                        {/exp:xml_encode}
                                {/exp:word_limit}
                        </li>
                {/items}
        </ul>
{/exp:magpie}

The outer “magpie” Plugin has the parameter set to parse inward, so it is parsed first. This makes the {content} variable’s content available to the other Plugins. Next, is the “word_limit” Plugin. However, since by default EE parses Plugins outward, the “xml_encode” Plugin is parsed first and then “word_limit” after it. In this way, “word_limit” will never erase the closing tag for the “xml_encode” Plugin.

User Contributed Notes

Posted by: philfreo on 21 April 2013 1:19am
philfreo's avatar

The word_limit plugin can be downloaded from https://github.com/EllisLab/Word-Limit

The other downloadable plugins are listed here: http://ellislab.com/expressionengine/user-guide/#available-for-download

Posted by: vlad_i on 12 October 2011 9:58am
vlad_i's avatar

The folder that your plugin is in is supposed be named EXACTLY as the actual .php file minus the pi., ft. or whatever extension b4 it… or it wont read it!

IE
pi.word_limit.php the folder should be named “word_limit” not wordlimit or word-limit

Some files just come as pi.word_limit.php, without the containing folder. It took me a minute to figure this out.

You must have an EllisLab product license and have at least 50 posts to the community forums to contribute notes to the User Guide