7

The problem with that is that if {parent_id} doesn't get replaced with a number before the conditional is evaluated, then EE will choke because when converted to PHP it becomes: if ({parent_id} == 0) Either this {if parent_id != 0} Or this {if "{parent_id}" != "0"} Is more fault tolerant when the variable doesn't exist. But, you may wonder, why is ...


4

The nested instances of switchee should not have the exp prefix. {exp:switchee variable="{variable_1}" parse="inward"} {case value="{variable_1}"} {switchee variable="{variable_2}" parse="inward"} {case value="{variable_2}"} some text {/case} {case default="yes"} some other text {/case} {/switchee} {/case} ...


4

While you could easily use Stash to pass the entry ids as a variable, you shouldn't. To create the variable would mean iterating over the entire list of entries in a channel. That's expensive just for a simple routing operation. Assuming this is being run on your site's default index template, and you have strict 404s disabled, why not just redirect if ...


3

If you look at the documentation a bit more carefully, you'll see that the {case value="xxx"} tags only use a single = sign. So, this should work {exp:switchee variable = "{champions}" parse="inward"} {case value="team 3"} <p>team 3</p> {/case} {/exp:switchee}


3

You are doing a ton in your template. After a quick look I'd say your slowness is related to your relationship fields. I suggest installing the EE Debug Tool to determine what specifically is "slow" on the page load. That will help you decide how to optimize the template. I also suggest taking a look at CE Cache to see if it makes sense for your project.


3

This is a tag parse order problem, and it arises because you are (if I understand you correctly) setting your 'page_title' variable in the view template (the embed) - and trying to access it in the same template. Something like this: {exp:switchee variable="{segment_1}" parse="inward"} {case value=""} {sn-home-data} {/case} {case default="yes"} ...


2

It's easy, actually. You can concatenate both segments. I used to use some RegEx for this, but I just got the idea to take advantage of the parsing order. Please, try this: {exp:switchee variable="{segment_2}/{segment_3}" parse="inward"} {case value="/"} {embed="travels/travels"} {/case} {case value="{segment_2}/"} {embed="...


2

With Stash: {exp:stash:set name="categories" parse_tags="yes"}{exp:gwcode_categories channel="products" depth="1" style="linear" backspace="1"}{cat_name}|{/exp:gwcode_categories}{/exp:stash:set} {exp:stash:parse} {exp:switchee variable="{segment_2}" parse="inward"} {case value="#^P(/d+)$#|category|''"} {switchee variable="{segment_3}"} ...


1

As @checyney said there is no channel:entries loop yet. I'd suggest you do it something like this: {case default="Yes"} {exp:channel:entries} {switchee variable="{status}" parse="inward"} {case value="open"} {embed="somegroup/_sometemplate-open" the_entry_id="{entry_id}"} {/case} {case value="...


1

Frankly, ExpressionEngine code conditions to convert in switchee or law variables will not increase page speed. To enhance the performance, you should try this plugin for if condition:(EE2) URL To increase the page speed, There are several ways (You can use all of them) Use CE Cache Plugin: (EE2) URL Enable Gzip compression from .htaccess # BEGIN EXPIRES ...


1

In short: no. Low Seg2Cat looks at full segments, which in your example is order#cakes, not order, nor cakes. Your better bet is to, rather than use a hash in your URL to indicate a filter, simply append the category_url_title as a new segment. So, link your filters to order/{category_url_title}, and then manually change your URL to that link when your ...


1

You could achieve this with Low Search, the Field Search filter and enabling smart_field_search. That will apply the search:field parameters only to the channels the field is assigned to. {exp:low_search:results channel="aprod|bprod|cprod" search:a_wn="=YES" search:b_wn="=YES" search:c_wn="=YES" smart_field_search="yes" }


1

Without going to a custom query you could try one master exp:channel:entries tag like: {exp:channel:entries channel="fprod|brod|drod|etc" disable="category_fields|member_data|pagination|trackbacks" dynamic="no" orderby="entry_date"} {if f_wn == "YES"} Product title, thumbnail, category (brand), etc. {/if} {if p_wn == "YES"} Product title, thumbnail, ...


1

It looks like you're simply testing to see if the nested entries are empty or not. Could you not use something like: {exp:stash:get_list name="buy_now_options" parse_tags="yes" parse_conditionals="yes"} {exp:stash:get_list:nested name="purchase_urls"} {if no_results}Show default link{/if} // There must be entries so show them {exp:stash:get_list:...


1

You just need to set the parse parameter to inward if you want to discard the content of the unmatched cases before parsing them or you are using a module or plugin tag as a parameter. The RegEx you're using, /[0-9]+/, will match strings containing a number, not being one. Please, try: {exp:switchee variable="{segment_2}" parse="inward"} {case value="#...


1

If all this are fields within the same exp:channel:entries, to use switchee or IfElse will make no difference. Conditionals which uses module data are parsed by the module. There's no reason for use an addon. Take a look at this answer of Low. Or start by the slide 66 of his presentation. The key to use this add-ons is to avoid unnecessary parsing, what, ...


1

parse="inward" is the villain here. Switchee is being parsed before the exp:gwcode_categories. Since I believe you need the parameter, your option is to force exp:gwcode_categories to be parsed early. Let's try using embeds. {embed="group/template" categories="{exp:gwcode_categories channel="products" depth="1" style="linear" backspace="1"}{cat_name}|{/exp:...


1

Lets tidy this up: {exp:stash:set name="home_page_blocks" parse_tags="yes" trim="yes"}//Trim removes whitespace {exp:channel:entries channel="pages" backspace="1"} // Remove last '|' {select_left_blocks}{select_left_blocks:entry_id}|{/select_left_blocks} {/exp:channel:entries} {/exp:stash:set} This should now output a list like "33|23|35" - ...


1

There is in fact a default="" parameter available for Stash set, however it only comes into play if you define a match parameter to test the value being set against a regular expression: Thus this will do what you want: {exp:stash:set name="head_title" match="#^\S+#" default="{title}"}{news_meta_title}{/exp:stash:set} One problem with this approach ...


1

I think this might be due to using an advanced conditional, which I guess could result in parse order issues. Maybe this would work: {if news_meta_title} {exp:stash:set_value name="head_title" value="{news_meta_title}"} {/if} {if news_meta_title == ""} {exp:stash:set_value name="head_title" value="{title}"} {/if} If not, have you tried adding ...


1

I guess you could wrap that whole block with {exp:stash:parse process="end"} ... {/exp:stash:parse} to make it all parse at the end. Like this {exp:stash:parse process="end"} {if news_meta_title} {exp:stash:set_value name="head_title" value="{news_meta_title}"} {if:else} {exp:stash:set_value name="head_title" value="{title"} {/...


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 tried Bjorn's last segment plugin to get the absolute last segment and that worked. Weird... http://devot-ee.com/add-ons/bjorn-last-segment Switchee tag: {exp:switchee variable="{exp:last_segment ignore_pagination='no'}" parse="inward"}


1

Get yourself a copy of ifelse by Croxton - this will evaluate your conditionals but only output the condition that is met. OOB EE conditionals evaluate everything and then displays what is met. so your code would look like this {exp:ifelse parse="inward"} {if "{url_title}" == "supports-for-adults"} {exp:stash:set_value name="support_type" ...


1

Since you don't have a default {if:else} case, try using simple conditionals compared against segment_1 (since that's setting your entry anyway). {if segment_1 == "supports-for-adults"} {exp:stash:set_value name="support_type" value="Adults"} {/if} {if segment_1 == "supports-for-children"} {exp:stash:set_value name="support_type" value="Children"} {/...


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