Snippets are small bits of reusable template or tag parts in ExpressionEngine.

learn more… | top users | synonyms

0
votes
1answer
9 views

Snippet encoded as utf-8 causes blank text to be inserted above it

I have a snippet used for navigation that causes a "blank" bit of text to be inserted into the rendered DOM when the encoding for the snippet file is set to utf-8 but not when the snippet encoding is ...
0
votes
1answer
20 views

Include CSS file in JS

I have a problem with url in js file First, in Snippets i have code In that init.js i have that (function($) { skel.init({ reset: 'full', breakpoints: { global: { range: '*', ...
0
votes
1answer
19 views

White screen with syncing files

Experiencing a very strange error at the moment that I can't put my finger on. Running EE 2.7.0 and any time I try to sync a file from the CP to file system (using something like Libraree, Snippet ...
1
vote
1answer
36 views

How do I allow users to add a snippet without having to access the template?

I want to setup a bunch of snippets (or even embeds?) and give users the ability to place these within their pages, but without having to create special templates or pre-defining where in the template ...
1
vote
2answers
84 views

How to reference snippet variables inside a stylesheet template

EE doesn't seem to be parsing {snippet} tags inside a template of type stylesheet - I'm guessing because the curly braces conflict with CSS's own braces indicating the start of a style declaration. Is ...
0
votes
2answers
60 views

Dynamically create swiper based on images in wygwam field

I'm using ExpressionEngine and have a wygwam field that takes html formatting, including img tags. I was wondering how I could dynamically create a swiper based on these images? I was thinking that if ...
0
votes
1answer
50 views

no_results not working when moved to snippet

I have moved embed code to be a snippet. After that move no_results stopped to work (part of the code below) {exp:channel:entries channel="products" category="{segment_2_category_id}" orderby="title" ...
2
votes
1answer
116 views

Stash snippets vs “native” snippets

I consistently use a few Snippets for things like HTML HEAD boilerplate code, and I've long used the Snippet Sync add-on to give me easy file access to the snippet code. Now that I'm consistently ...
3
votes
2answers
62 views

Addons - Snippets as files

Is there a well-supported, 2.7.x+ compatible add-on to save Snippets as files like what we can do to templates in Expression Engine? I think there are a lot of options out there but I just want ...
2
votes
2answers
115 views

Seg2Cat blank values

I've installed (new) seg2cat on a new EE upgrade (2.7.2) and it isn't behaving as expected: (1.143091 / 6.09MB) Snippets (Keys): ...
2
votes
2answers
170 views

Snippet inside snippet not rendering

On a template I am calling in a series of snippets like so: {sn-head} {sn-header} {sn-page} {sn-listing-videos} {sn-footer} The sn-listing-videos snippet contains an entries loop like so: ...
0
votes
2answers
75 views

Wrong PHP parsing order in snippet

I'm trying to parse a global variable inside a snippet that represents my page footer, and I want to perform a string function on the content of that variable. The snippet is being called into a ...
2
votes
1answer
70 views

Where are EE's native Snippets saved, locationwise?

I just moved a site to another server and duh! forgot to copy over the Snippets manually. Don't ask. I have a full backup though, ftp as well as sql. Now I am wondering where the native EE Snippets ...
1
vote
1answer
57 views

Is it possible to place an embedded template within a snippet?

Is it possible to place an embedded template within a snippet? Reason is I have a client that wants to be able to use the Allow More EE Code plugin http://devot-ee.com/add-ons/allow-more-ee-code to ...
0
votes
2answers
108 views

Strange parsing issue after switching from embeds to Low Variables snippets

My coworker and I are baffled by a recent issue that came up when we switched all of our embeds over to Low Variables. The weirdest part is that the issue is happening on his machine, not mine, and we ...
2
votes
1answer
460 views

Can snippets contain PHP?

The documentation says: 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. ...
0
votes
3answers
146 views

Snippet Syncing not working

I am building an html5 theme into expression engine. The theme came with a lot of JS that wasnt needed and it slows the pages down. When initially building the theme into expression engine i broke the ...
1
vote
0answers
41 views

Snippets (snippetsync) only parse when logged in

It seems that some newly created snippets using SnippetSync (version controlled and uploaded via GIT/Beanstalk) begin parse only after I log into the control panel. After a day or so these snippets ...
2
votes
2answers
249 views

Is there a way to change the parse order of snippets or plugins?

Is there a way to force snippets or plugins to be parsed late or at least after advanced conditionals are parsed?
0
votes
1answer
91 views

Playa with conditionals and snippets

I seem to have a problem with Playa + conditionals + snippets. I've emailed P&T since it may be an error in Playa. I'm trying to accomplish a listings page where the information displayed depends ...
5
votes
3answers
242 views

Breaking my HTML into tiny pieces - template, snippets, or globals?

In order to maximize code reuse, I'm trying to break down the mark up for each of my form fields into individual "containers" (e.g. a template, snippet, global). The project I am working on is ...
3
votes
2answers
113 views

Is there a way to define snippets in the index.php or config.php file?

I'd like to define snippets dynamically in the index.php file. Is there a way to do this?
2
votes
2answers
115 views

Why isn't this snippet + Zoo Triggers working?

I have a set of "category" pages such as: Dining (example.com/dining) Nightlife (example.com/nightlife) We are using Zoo Triggers to filter out the categories appropriately. I am using a snippet ...
2
votes
1answer
503 views

EE conditionals within javascript snippet

I am trying to use EE conditional statement within Javascript. The Javascript is called through a EE snippet. Part of the problem is I am using js conditionals right below my EE conditional. Is this ...
1
vote
3answers
380 views

Email encode tag Javascript issues

I use {encode="{webmaster_email}" title="Send E-Mail"} to hide my email address from harvester bots. When I use this code within my template all is fine. This code is also part of the footer. The ...
4
votes
5answers
410 views

What add-on/method do you use to create snippets as files? [closed]

For version control purposes, it's better to store snippets as files. What add-on or method would you recommend?
5
votes
4answers
510 views

Why is this Low Variable in a snippet not parsing?

I have a snippet that I use on nearly every page of a site. I need to give the admins some control in the fallback source of an image in that snippet. Now I know there is a parse order issue here as ...
9
votes
2answers
1k views

What is the difference between a global variable, a snippet and an embedded template?

What is the difference between a global variable, a snippet and an embedded template? When and where should I be using each of them?