x
 
Create New Page
 View Previous Changes    ( Last updated by Lisa Wess )

Embeds Or Global Variables

Check out the developer blog post: Behind the Curtains: Part II for some great information on this.

Question:

I’m a new EE user and I’m having a hard time distinguishing between embedded templates and global variables. The user docs don’t really help to explain the differences and how they are used together. Would someone please explain them?

Answer:

Simple difference - you can’t use php or ee tags in global variables. You can in templates. Big difference.

Global variables are for more things that you can just put straight html/normal stuff in, that don’t require further parsing. For instance, if you call your path often, you could make a global variable {my_path} and then use that everywhere so that if you say.. change hosts, you can update that more quickly by editing the global variable, rather than editing everywhere in your templates that it would appear.

Category:Tips

Categories: