Questions tagged [snippets]
Snippets are small bits of reusable template or tag parts in ExpressionEngine 2, renamed Template Partials in later versions.
38 questions
0
votes
2
answers
112
views
Use php inside entry-field instead of snippet
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 '...
0
votes
2
answers
196
views
How can I pass the category ID of the current entry into the exp:calendar:cal tag?
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 ...
0
votes
1
answer
88
views
EE 3.x - Import from EE 2.x to EE 3.x all Snippets
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 ...
0
votes
1
answer
134
views
EE 2.5.5 how to use snippet in if statement
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 ...
0
votes
1
answer
239
views
Snippet Changes Not Being Saved
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 ...
1
vote
1
answer
152
views
Why are all snippets loading several times on page load?
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 ...
0
votes
1
answer
220
views
Embedding snippets or templates from wysiwyg?
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)...
0
votes
1
answer
442
views
How do I check for a null or blank snippet?
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 ...
0
votes
1
answer
102
views
Conditional Comparison Operator Not Working With Snippet
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 ...
1
vote
2
answers
518
views
Insert Code into Middle of Channel Entry Post
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 ...
0
votes
1
answer
68
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
1
answer
202
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
1
answer
101
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
1
answer
157
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
2
answers
287
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 ...