Skip to main content

Questions tagged [snippets]

Snippets are small bits of reusable template or tag parts in ExpressionEngine 2, renamed Template Partials in later versions.

Filter by
Sorted by
Tagged with
0 votes
2 answers
133 views

How is it possible to use php inside an entry-field? When I write e.g. in the summary-field test <?php echo 'bla'; ?> test I get exactly the same string in the frontend: test <?php echo '...
BNetz's user avatar
  • 470
0 votes
2 answers
211 views

I have an entry assigned to a specific category. I want events from exp:calendar:cal that share the same category to be displayed on the same page. When I hard code the category ID it works like a ...
Matt's user avatar
  • 25
0 votes
1 answer
97 views

I started with a fresh EE 3.3.0 installation on my localhost. However, I would like to bring over ALL the Snippets that I am using on my Production website to my brand new localhost EE 3.3.0 site. I ...
L.Callif's user avatar
0 votes
1 answer
140 views

I have a multi site EE set up and I have set up a snippet to use in my template. The snippet syntax is {current_site_name} and the content that the snippet outputs is {site_name} I am trying to use ...
tuscan88's user avatar
  • 147
0 votes
1 answer
246 views

I'm working on a site in ExpressionEngine which has been causing all sorts of problems, and we thought we had solved most of them, but now have run into a completely new issue which I can't seem to ...
Jonathan's user avatar
1 vote
1 answer
160 views

I have a simple about page being rendered with the content of only one entry and some Low Variables bits. It's rather slow (3.8806 seconds according to the Output Profiler), and the Template Debugging ...
huertanix's user avatar
  • 117
0 votes
1 answer
230 views

I have a snippet (can be template if necessary) which contains a diagram as code. Is there anyway to make this selectable from the edit entry screen, and preferably associated with a wysiwyg (Expresso)...
Kieran McClung's user avatar
0 votes
1 answer
449 views

I want to have some fallback text for when a snippet isn't available. I tried this: {if '{snip-start-to-end-dates}' != ""} {snip-start-to-end-dates} {if:else} Long-term Installation {/if} ...but ...
huertanix's user avatar
  • 117
0 votes
1 answer
110 views

I am trying to get a snippet that calculates a value and compare the result to a number - the value is correctly outputted from my snippet when I include the var by itself. However when I use the ...
Alan Miller's user avatar
1 vote
2 answers
526 views

I have a channel that stores ads (HTML ads I created and the Google Adsense Code block), and displays either my html or Google's JS to allow a random ad on each page load. I want to insert that ...
Kilpatrick's user avatar
0 votes
1 answer
76 views

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 ...
Cheyney's user avatar
  • 339
0 votes
1 answer
212 views

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: '*', ...
IMWDS's user avatar
  • 43
0 votes
1 answer
104 views

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 ...
Steven Grant's user avatar
  • 2,473
1 vote
1 answer
167 views

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 ...
JustinXyn's user avatar
1 vote
2 answers
299 views

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 ...
mheavers's user avatar
  • 467
0 votes
2 answers
405 views

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 ...
Kenny Bones's user avatar
0 votes
1 answer
132 views

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" ...
JackTheKnife's user avatar
2 votes
1 answer
263 views

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 ...
Jay F's user avatar
  • 1,889
3 votes
2 answers
320 views

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 ...
developarvin's user avatar
  • 2,347
3 votes
2 answers
275 views

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): segment_category_ids|segment_1_category_id|...
Caroline from Aquarian's user avatar
3 votes
2 answers
581 views

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: {exp:...
Katrin's user avatar
  • 205
0 votes
2 answers
197 views

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 ...
Standout Digital's user avatar
2 votes
1 answer
177 views

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 ...
Marc's user avatar
  • 502
1 vote
1 answer
100 views

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 ...
Garrant Consulting's user avatar
0 votes
2 answers
209 views

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 ...
Gary Reckard's user avatar
3 votes
1 answer
910 views

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. The ...
Mark J. Reeves's user avatar
0 votes
3 answers
435 views

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 ...
Jam Crowe's user avatar
1 vote
0 answers
70 views

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 ...
Dan Johnson's user avatar
  • 1,110
3 votes
2 answers
719 views

Is there a way to force snippets or plugins to be parsed late or at least after advanced conditionals are parsed?
developarvin's user avatar
  • 2,347
0 votes
1 answer
145 views

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 ...
Paul's user avatar
  • 692
5 votes
3 answers
367 views

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 form-...
ExpressionEngineNewbie's user avatar
3 votes
2 answers
207 views

I'd like to define snippets dynamically in the index.php file. Is there a way to do this?
Travis Smith's user avatar
2 votes
2 answers
175 views

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 to ...
Dan Johnson's user avatar
  • 1,110
3 votes
1 answer
1k views

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 ...
Shan Ricciardi's user avatar
1 vote
3 answers
927 views

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 ...
awa's user avatar
  • 525
4 votes
5 answers
656 views

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

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 ...
Dan Johnson's user avatar
  • 1,110
15 votes
2 answers
3k views

What is the difference between a global variable, a snippet and an embedded template? When and where should I be using each of them?
foamcow's user avatar
  • 7,156