6

My choose is Bjorn SnippetsSync - simple and stable


5

For visibility, this is what your snippets look like: [segment_category_ids] => 241 [segment_1_category_id] => [segment_1_category_parent_id] => [segment_1_category_group_id] => [segment_1_category_name] => [segment_1_category_description] => [segment_1_category_image] => [segment_2_category_id] => [...


4

Yes, as long as the template in which you put the snippet has PHP enabled.


4

They're stored in the exp_snippets database table.


4

While use cases for it are rare, CSS templates can parse tags if you need them to, but you must link to them with {path='template_group/css_template'} instead of {stylesheet='template_group/css_template}.


3

Snippets are not intended to be used by / known by end users. They are developer tools for making your code more DRY - not so much to hold content. This is why the access to them is through the Templates area of the CP rather than the Content area. Here is one approach to allowing users to create different sidebars - note that you could use the native ...


3

I personally prefer Low Variables as it does so much more than just let you edit as files. You can control the parse order allowing you to create global variables or snippets. Plus it works with a whole bunch of field types making it extremely useful for content that clients need to edit but don't deserve a channel. And yes you can hide variables/snippets ...


3

That looks like expected behaviour to me. I'm assuming that you're seeing this at a URL which has a category slug in segment_3 and nowhere else, so all of the other Seg2Cat variables are empty. What was the behaviour you were expecting?


3

This is due to the parse order. EE parse snippets at a very early stage all at once, hence not being able to have a snippet within a snippet. I suggest removing the {sn-listing-pageination} and just hard code that in the {sn-listing-videos}. Or you could convert all your snippets/variables over to Low Variables and set the {sn-listing-pagination} to a ...


2

You can fetch that global variable like: $address = ee()->db->select('variable_data')->where('variable_name', 'address')->get('global_variables')->row('variable_data'); echo trim(str_replace(array("\r\n","\n","\r"), ', ', $address)); It would work for you.


2

EE's CSS and JS templates do not parse variables or tags. They're just static templates. Best to avoid EE altogether and just create CSS and JS files on the server. To still be somewhat dynamic, you can always hard-code rules in the <head> (for CSS) or above </body> (for JS). For example: <style> .style { width: {snippet_width}px;...


2

First of all, the stylesheet tag needs quotation marks. {stylesheet="global_embeds/style"} If you link to the JS file using path variable, all the templates variables on the linked file will be parsed. {path="global_embeds/init.js"} But I really don't think it's good for performance. It's much better to use static links for the JS and CSS.


2

The snippets are not actually "loading" - they are simply bits of text being stored in memory (much like global variables). They aren't actually processed until they're called. So they're not an overhead problem. You'll see these being "loaded" each time you run the template engine - which means the primary template, and then each embed.


2

So if you only want a snippet to display on certain entries, you can apply that via a field and small code addition to your template(s). I understand you have a lot of templates and don't want to add more; there is no reason to add more. You can just edit the templates you currently use for these entries, and they'll work either way. In this example, just ...


1

It is possible with a bit of messing around you could achieve what you are trying to do by installing the Allow EE Code add-on. This add-on makes it possible to evalute EE template code placed within entries in EE channels - to use you simply bracket the template output you want to have evaluated between an {exp:allow_eecode} tag pair. So it might be that ...


1

If you look at the parse order of the template engine, you'll see that although snippets do get parsed before conditionals, standard global variables (which includes {site_name}) don't get parsed until after conditionals are evaluated. This means that you are literally using "{site_name}" in your string comparison, which of course never matches any of your ...


1

I'm not so sure on the Expresso Editor, but if you are using WYGWAM as your WYSIWYG editor... If this is the case this might be of some interest to you : https://github.com/pixelandtonic/wygwam_template_links never used it so not quite sure if it's exactly what you want... Also see this article which may give you clues on how tyou could hijack the Template ...


1

Another option would to go with a Blocks or Content Elements approach, where your content is actually a list of content building blocks. Then you can have any combination: text-ad-text, text-ad-ad-text, text-ad-text-ad-text, text-somethingelse-text-ad-text, etc. The value of that is that editors can just click on an "Ad" button, instead of needing to ...


1

So as it turned out, this was nothing to do with EE or any of the addons installed. We had installed Trace to manage db changes between environments. For the most part, this worked well...until it didn't. One of the changes that module introduces is a change to your db config, setting the mysql drive to mysql_trace Arbitrarily, I reverted this back to the ...


1

You could use another field type for the images in the post. Grid would be one that would work without going to a third-party resource. Channel Images is a solid commercial addon that handles multiple images in an entry really well.


1

Well, it is issue related to switchee (thanks Robson Sobral for pointing me to that). The {if no_results} behaviour is ‘owned’ by the outer wrapping tag not the inner tag. This is an EE bug/feature and not unique to Switchee. Because of this, Switchee has it’s own no_results handling which will work for each nested switchee layer: {if switchee_no_results} ...


1

I like to use Snippet Sync (http://devot-ee.com/add-ons/snippet-sync) on all of the sites that I work on and we do the same for the sites that we build at The Nerdery. Using Snippet Sync allows us to save snippets as files which we've found to be much easier manage and it makes it possible to keep snippets under version control which is invaluable. It also ...


1

This is because user-defined global variables are parsed very late - after PHP on input, after all module and plugin tags, and even after PHP on output (see parse order). Your best bet here is to write a simple plugin which fetches the global variable directly from the database, does its work, then returns it.


1

As long as you don't notice any performance hits, its perfectly acceptable. Another solution you might try is to use Low Variables instead of embeds. This is possible as of version 2.3 thanks to this parameter: preparse:my_var="" Read more about this method here.


1

So, after following a hunch, this is indeed due to the way new lines/carriage returns are handled on some Windows environments. To fix, open up base.low_variables.php, look up the line that says: array('variable_data' => read_file($file)), And change that to: array('variable_data' => str_replace("\r\n", "\n", read_file($file))), In LV v2.3.1, that'...


1

I know this is old, but I ran into this issue and fixed it by setting "Automatically turn URLs and email addresses into links?" to "No" in the appropriate Channel's preferences page (Admin -> Channel Administration -> Channels -> Edit Preferences).


Only top voted, non community-wiki answers of a minimum length are eligible