Can someone clarify/demonstrate the difference between the two.
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
December 14, 2009 5:07pm
Subscribe [5]#1 / Dec 14, 2009 5:07pm
Can someone clarify/demonstrate the difference between the two.
#2 / Dec 14, 2009 5:09pm
Snippets are parsed at an earlier stage and can themselves contain other EE tags, even PHP code.
#3 / Dec 25, 2009 9:18pm
For me is still not clear the difference.
Can variables contain EE Tags aswell or only Text and HTML/CSS code?
Could someone make a table showing the differences or give some examples of both in the praxis?
Thanks 😊
#4 / Dec 25, 2009 9:28pm
I reply myself 😊
I found this in the Docs:
What is the difference between a Snippet and a User-defined Global Variable?
Snippets are expanded at a very early stage on each template, making it possible for them to hold dynamic content, ExpressionEngine tags, other variables, PHP, etc. They shine when you need to reuse dynamic information, but don’t need the extra overhead of access control or separate preferences of an embedded template. User-defined Global Variables are the polar opposites, expanded at the very end of all template parsing, and should be used for static text, HTML, JavaScript, and other static content that would not affect other tags and variables on the template.
So is clear.. Snippets ar for Dynamic CODE and EE Tags, and Global Varibles for Text - HTML,CSS, Javascript so static.
You could have called it “Dynamic Snippets” it would be clearer 😊
Thanks
#5 / Dec 25, 2009 10:39pm
Snippets are parsed at an earlier stage and can themselves contain other EE tags, even PHP code.
I see where Snippets go. How are they invoked? How do you get the snippets into a template?
#6 / Dec 25, 2009 11:03pm
Once defined under Design-Templates-Snippets, snippets are invoked within a template in the same manner as a global variable or custom field: {some-snippet}
#7 / Dec 25, 2009 11:14pm
Once defined under Design-Templates-Snippets, snippets are invoked within a template in the same manner as a global variable or custom field: {some-snippet}
So, it’s just a copy and paste routine (at best), or type it in (based on memory)?
Are snippets usable across multiple weblogs (sites)?