Published by Mijingo

movie icon image

EE Insider Blog

Spend your time learning and developing sites with ExpressionEngine and we'll use this blog to keep you informed of all the news related to ExpressionEngine and CodeIgniter.

» Read more in the Archives.

» Have a tip? Send us your EE news.

Learn ExpressionEngine Today

Over a series of 8 videos, watch and learn as Ryan builds an entire ExpressionEngine website from beginning to end. Get started now.

Using Snippets, Preload Replace Variables and the Parse Order

The king of the EE parse order, Low Schutte, has dazzled us once again with a great way to leverage the EE parse order to make your templates even more flexible and reusable than you thought possible. What do you get when take Snippets, Preload Replace Variables and the Parse Order? Super flexible templates that don’t have the overhead of embed templates. That’s what.

According to EE’s parse order, snippets are parsed first, before preload replace variables. These, in turn, are parsed before plugin and module tags, so both can be used as early parsed variables. This combination makes it possible to change the content of your snippet on a per template basis. Much like embeds and embed variables, but without the performance hit.

A series of Preload Replace Variables set your template values and then the snippet just uses those variables to pull in the right data. Read the entire blog post from Low (or, if you’re like me, read it twice) to get all of the details, including some sample code.

Very cool.

Posted on Nov 17, 2011 by Ryan Irelan

Filed Under: Development Tools, ExpressionEngine 2