Retired Documentation:  You are using the documentation for version 1.7.3 which was retired in 2013. Go here for the latest version documentation or check here for your available upgrades to the latest version.

Using Plugins

ExpressionEngine is designed so that features can be added through the use of Plugins.  The ExpressionEngine Plugins site contains a list of all available plugins, as well as installation and usage instructions for each one. The following are generic instructions that will work for most plugins. Its important to review the notes for the specific plugin you wish to use.

Installation

Plugin installation in ExpressionEngine is extremely easy:

If you are running EE version 1.2.1 or newer and you meet all of the requirements for using the Plugin Manager, you can simply click the "Install" link for the desired Plugin in the list of Available Plugins in the Plugin Manager. The Plugin will then be automatically installed.

Plugins may also be manually installed by following these simple instructions. (Note: a few Plugins may have additional — or optional — steps that can be performed. Be sure to consult the notes included with the entry.)

  1. Download the Plugin to your local computer. You'll usually need to unzip the file.
  2. Log into your server via FTP and browse to your system/plugins/ directory.
  3. Upload the new Plugin .php file. Be sure to upload in ASCII ("text") mode.

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.

Top of Page