4 votes
Accepted

check if a segment is a number

Using the matches operator, which was added in EE v2.9.0: {if segment_2 ~ "/^\d+$/"} [...] {/if}
user avatar
  • 6,108
2 votes

Appending more data to a layout variable

Unfortunately, for now, version 2.9, there isn't. But I suggest you to ask EllisLab for it. I guess isn't that hard to implement, but they are possibly busy because of the EECI Conf. This and an ...
user avatar
  • 6,108
2 votes

Expression Engine - Passing Custom Field Variables to Layout

If your trying to pass a simple value to your layout, you can set it on the layout tag. For example: {layout="pages/.layout" body_class="contact"} But custom fields variables need to be parsed by ...
user avatar
  • 6,108
2 votes

Include CSS file in JS

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 ...
user avatar
  • 6,108
2 votes
Accepted

Are {layout:set} variables available to all extended layouts?

From my own testing, the value set for the {layout:title} variable will cascade back through the layout templates to the outermost layout. So if you set it in a nested template or a template that ...
user avatar
2 votes
Accepted

I'm having trouble getting simple IF statements within a Playa tag to evaluate properly

There are some issues in EE 2.9 with conditionals on prefixed variables and variable modifiers which I don't totally grok. (See bug report here for some discussion.) But the moral is, try this: {if '...
user avatar
  • 17.4k
1 vote

What is the updated version of assign_variable?

The best way of creating transient values within a template is through EE's built in layout variable system. Layout variables can be defined as single values or as part of an addressable array, and ...
user avatar
  • 3,572
1 vote

CE Image, variable not parsed inside src image

Stash is very useful sometimes, but also is notorious for exactly this kind of obscure fail behaviour. Just look at the kind of questions asked about stash in this forum and you will see that you are ...
user avatar
  • 3,572
1 vote

Insert Selected Channel into the Template

If you are planning to develop a 'generic' block of template code and then reuse it multiple times within your site, you necessarily need a mechanism for specifying what data you want to display ...
user avatar
  • 3,572
1 vote

CE Image {height} & {width} variables outputting incorrectly

We are using the following without any issue: {exp:ce_img:pair src="{logo}" height="75" width="150"} <img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEAAAAALAAAAAABAAEAAAI=" data-original="{...
user avatar
1 vote
Accepted

Is it possible to limit display of products in the catalog on a per template basis in Brilliant Retail?

The BrilliantRetail catalog tag does not currently allow for changing the number of results to pagination per template. For your use case though I would consider a relationship or using the BR product ...
user avatar
1 vote
Accepted

Something wrong in Stash usage and cannot figure out what

You probably don't need to use stash in this case, and could test if in the categories within the conditional: {if "{categories show='51|50|39' limit='1'}yes{/categories}" == "yes"} //then print ...
user avatar
1 vote

Freeform Pro Dynamic Admin Notifications

You'll definatly need to develop an extension which hooks freeform. Sounds complicated but its real easy, I've done it many times with freeform (you'll be suprised what clieents ask for) and you'll ...
user avatar
  • 2,418
1 vote

Insert Code into Middle of Channel Entry Post

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-...
user avatar
  • 418
1 vote
Accepted

Expresso Store + outputting store variables using PHP in XML. " and / are blowing up the whole operation

It is in general not a great idea to use PHP straight in the template, but that's a story for another day. It would be best to use Expresso Store's developer hooks like the "store_order_complete_end" ...
user avatar
  • 241
1 vote

Is there a way to pass a category id from one entries loop to another?

I don't know if this will be helpful to anyone else, but I solved my problem. Basically, I went back to thinking of this as something best handled by relationships rather than categories. I realized ...
user avatar
1 vote

Email encode tag Javascript issues

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 ...
user avatar
1 vote
Accepted

How do I create a single template tag which outputs multiple bits of data?

The best coding practice is to utilize view files in order to achieve that.
user avatar
  • 2,831
1 vote
Accepted

var_prefix= not working as one would hope

Here was the final solution. {exp:playa:children field="3rd_order_under" sort="asc" var_prefix="thirdorder"} <li {if '{thirdorder:count}' == '1'}class="active"{/if} id="pillTab{...
user avatar
  • 73
1 vote

var_prefix= not working as one would hope

The inner exp:playa:children tag should not be prefixed. The var_prefix is for the variables inside the tag, not for other tags. You'll want to do something like this: {exp:playa:children field=...
user avatar
1 vote

var_prefix= not working as one would hope

To try and get a handle on what's going on, I would break things down to just the variable output and forget about the html markup until it makes sense. Try this and see if you can pinpoint it: {exp:...
user avatar

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