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

We use this code in our header embed; allows us to do something like {embed="site/_header" meta_title="Example Title"}; alternatively we can specify an entry ID, and SEO Lite will figure out the correct info, or, we can just let it rely on the last segment, which works 95% of the time. It's worth noting that we're also using Mark Croxton's IfElse add-on ...


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

For anyone that has encountered this same issue, Mark Croxton was able to solve the issue at the devot-ee support forum. Essentially, wrapping the next_entry tag pair with a stash parse tag like so {exp:stash:parse}....{/exp:stash:parse} on the first code block solves the issue. Full support thread: http://devot-ee.com/add-ons/support/stash/viewthread/9131


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"} ...


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

I suspect the variable portfolio_size is actually a custom field in your portfolio channel. So you just need to simplify a little, wrapping your entries loop around the switchee tag pair. So something like this is what you need: {exp:channel:entries channel="portfolio" orderby="date" sort="desc" limt="1"} {exp:switchee parse="inward" variable="...


2

Fabio! Your snippets will load any way. They are loaded before the parse of all modules. But this code should word as you're planing. The content of the unmatched snippets will be removed of your template. Buuuuuuuuuuuuuuuut, from where are you calling the portfolio_size? Are you using a exp:channel:entries variable pair around the switchee? Because, the ...


2

exp:stash:get_list is a variable pair. So, try exp:stash:list_count: {exp:switchee variable="{exp:stash:get name='custom_sidebar_text'}/{exp:stash:list_count name='related_articles'}/{exp:stash:list_count name='related_events'}" parse="inward"} {case value="/0/0"}{/case} {!-- Ignore no value --} {case default="Yes"} <aside class="{exp:stash:...


2

So with some trickery here's how I managed to get it working, you'll need: Stash, GWcode Categories & Switchee URLS conform to either of these: mysite.com/products/category/list-entires mysite.com/products/category/sub-category/list-entries {!-- Create list of top level categories WITHOUT children --} {exp:stash:set name="flag_categories_1" save="yes" ...


2

By this way, the gallery_type isn't being parsed by the exp:channel:entries. Try this: {exp:channel:entries channel="collections" disable="categories|category-fields|member-data|pagination" status="open" limit="1"} {exp:switchee variable="{gallery_type}" parse="inward"} {case value="portrait"} Portrait {/case} {case ...


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

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

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"} {/...


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

According to a forum post on Devot:ee, you can't do less thans or greater thans inside the case values. You'll need to use a regular expression. http://www.regular-expressions.info/numericranges.html explains how to define numeric ranges. But for your example, case value="#^([0-9]|[1-9][0-9]|[1-9][0-9][0-9])$#" should match 0-999. (Your regex needs to be ...


1

The answer is: Don't use switchee on the site/index template if using a 404 template. My solution, Long Story Short: Use Pages for all segment-1-style one-off static pages. Break up the original template into two templates. The kernel of the answer was in my statement: Based on James Smith's URL schematic which he mentions here on EESE (topic: ...


1

As it turns out, this was actually an error on the part of the original data migration. I really should have checked that out first. It seems that the url_titles were never migrated, for whatever reason that could be. https://www.dropbox.com/s/a6x457jdgwzsu37/Screen%20Shot%202013-07-29%20at%203.16.36%20AM.png


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