3rd Party (Commercial)
Current Version: 1.2.0
Release Date: Jul 28, 2010
- jQuery for the Control Panel
The String plugin allows you to create and manipulate variables in your templates. This plugin is designed to take advantage of ExpressionEngine's unique way of parsing templates. Because the main template is executed to completion before any embedded templates are processed this plugin can be used to create a variable in the main template and output the value of the string in any embedded template... even an embedded page header template that comes before the point where you built the string!
Template Variables That Work
Having an embedded template that contains your webpage doctype, opening html tag, head content, and maybe the header of your site is very common and useful. It’s nice to be able to change that stuff in one place and have it change everywhere on the website. Unfortunately it can be very frustrating to pass page titles and meta descriptions to this embedded template on even moderately complex sites. Having to wrap your embed tag with a weblog/channel entries tag so you can pass parameters to the template is awkward at best, and it just gets worse from there.
The string plugin greatly simplifies this task… just build the variable wherever it’s most natural in the main template (where you’ll have your entries tag open anyway) and call on that value from the embedded template. String variable values can be tested with EE conditionals, too!
One Plugin, Many Uses
This plugin has been used successfully to do many things:
- page title, meta description, and canonical link tags
- retrieving the parent’s title within a related_entries/reverse_related_entries block
- relocating pagination to somewhere else in the template
- building breadcrumbs to display at the top of the page
- passing values from input mode PHP to EE template tags
Check out the code examples to see some of the ways this plugin can make your life easier.
Mmmm Dog Food
We used the string plugin extensively on our own site. It’s used for our page titles, meta descriptions, the breadcrumbs, canonical link tags, even some sidebar content. Come have a look to see what it can do for you. We’re convinced that we’ve only scratched the surface of what can be done with this plugin. If you have a particularly clever use, we’d love to hear about it.
- string plugin overview
- documentation (template tags)
- documentation (code examples)
- ExpressionEngine forum thread
This entry was created March 8, 2010, 6:45 am.
This entry was last updated July 28, 2010, 4:56 am.
Disclaimer: Information about ExpressionEngine add-ons is provided as a service to you, the user, and every member of the ExpressionEngine community. devot:ee is not responsible if you hose, mangle, wreck, or otherwise destroy your EE website by installing an add-on that you found out about at this site, regardless of its rating, Favorites status, commercial or free status, or general popularity. Caveat EEmptor!