Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [switchee]

Switchee is a free add-on which provides switch/case control logic in your templates.

0
votes
0answers
37 views

Template Routes vs Switchee in EE v4

I have several EE websites and since v2 I have been using Switchee to use a single template and "switch" between: pagination, category, single layouts. I have asked EllisLab and they say switchee ...
0
votes
0answers
20 views

Switchee redirect and status_code

I’m redirecting a page using that code {if switchee_no_results} {redirect="site/index" status_code="301"} {/if} Redirect works, but with a url like this: mysite.com/fr/site/index status_code=301 How ...
0
votes
2answers
34 views

switchee syntax error: {exp:switchee}

I am getting a syntax error when trying to set-up switchee on a new ee site. I am in 3.5.10 and I am using switchee v. 3.0. This is the first time using it in 3.x have used it several time on two ee 2....
0
votes
1answer
72 views

Cartthrob on_the_fly item options

I've got a cartthrob site where I have two product channels and then an "on_the_fly" product, where a user will enter their data for account number, price and client fields. Here is my add_to_cart ...
0
votes
1answer
25 views

Blank page output when using Entry Status in nested Switchee statement

I am trying to use a nested Switchee statement to display an embedded template but the results are a blank page. Using default status group and EE 2.11.5. I feel like I am missing something basic here....
1
vote
1answer
58 views

How to use Swtichee and/or Low Variables to optimise an if if:elseif if:else conditional statement

My page is loading really slow due to my inexperience. Can anyone help me speed things up by perhaps using Switchee and or Low Variables (and perhaps some Stash). I'm really just looking to be ...
0
votes
2answers
40 views

Switchee with 4 segments?

I need to switch on 4 segments. I'm a little confused. {exp:switchee variable="{segment_2}" parse="inward"} {case value="#^P(\\\\d+)$#|''"} Show all categories {/case} {case ...
0
votes
1answer
63 views

Need help to stop inner conditionals from parsing with with nested conditionals and stash

I'm really stuck and I know it's likely something small that I'm missing. I read the page in the wiki that relates to stash conditionals (https://gist.github.com/croxton/9d012297096892ca5c10), but I ...
0
votes
1answer
163 views

Low Seg2Cat and MixItUp

I have a bakery site that uses Switchee to use a single template to serve up multiple "pages", the content of each case is a snippet. On my order page, I have channel entries products whose ...
0
votes
2answers
47 views

Slow loading, multiple conditionals from multiple channels + sorting solution?

so i have a page that is slow to load. I have tried various alterations to this code but nothing has seemed to work for me. I read that 'Switchee' may be a solution, but i am not so sure. So I have ...
0
votes
1answer
89 views

Dynamically setting case value with switchee

I'm wanting to dynamically populate a switchee value, I've tried using an embed, but it seems the parse order means this won't work so I'm looking for aternative ideas, this is the code we've tried: {...
0
votes
1answer
109 views

Stash & Switchee parse order problems

I have the following blocks of code that I can't seem to to work correctly. The list sets and populates perfectly, but the switchee statement doesn't work. I konw that it has do do with parse order ...
0
votes
2answers
100 views

Switchee regex for numbers

Trying to get switchee to work with a regex check against a URL segment. For example following URL check if segment 2 is numeric: /property/123 Using: {exp:switchee variable = "{segment_2}"} {...
0
votes
1answer
117 views

Third segment / last_segment “success” not working?

I am attempting to display a message when the last segment equals "success"... I've done this many times before and for some reason I am having some trouble. I need an extra eye perhaps? Below is my ...
2
votes
1answer
276 views

Conditional with variable gives php error

I'm using channel:categories and would like to show only child categories so I added the following conditional {if {parent_id} != 0}...{/if} but get php errors as soon as I add it to the template. I ...
0
votes
2answers
105 views

Pass first level categories to switchee case value

I need to pass a list of the first level of categories to a nested switchee. The following works when I manually place the nested list. However I would like the client to be able to add/edit ...
1
vote
1answer
148 views

Issue with many relationship fields in a channel

I have a channel with 4 relationship fields and each entry can be related to one or two relationship fields. and I hide unnecessary fields using ENTRY TYPE(http://devot-ee.com/add-ons/entry-type) ...
1
vote
0answers
62 views

Help embedding categories into Switchee value field

I’m trying to embed categories into a Switchee value field but can’t get it to work. Can you help? To try to deal with the parsing order problem, I call the Switchee embed from my site/index template:...
0
votes
3answers
97 views

Problem calling a specific channel entry using segment_1 and page module

Ive looked at many Switchee questions here, but can't find out why my channel entry id's aren't being called in an embedded template. Switchee is working (with text for test), but Im obviously making ...
0
votes
0answers
57 views

Solspace tag entries pagination links

I'm using tag entries like in Docs {exp:tag:entries inclusive="yes" orderby="entry_date" sort="asc" limit="10" paginate="bottom" ...
2
votes
1answer
406 views

Nested conditionals with Switchee?

I'm trying to use Switchee for this scenario: {if variable_1} {if variable_2} some text {if:else} some other text {/if} {if:else} nothing to show! {/if} So, if i want to use Switchee i need to ...
1
vote
1answer
93 views

How can i set AND conditionals on Switchee?

Sorry but I'm unable to use switchee.. how can i set AND conditionals? this is my original code: <!--The Categories Page ////////////--> {if segment_2=="" AND segment_3==""} {embed="travels/...
2
votes
3answers
718 views

Conditionally set a Stash value

I'm using Stash to set a value like so; {exp:stash:set_value name="head_title" value="{title}"} However, I have now added a new channel field {news_meta_title} and would like to pass this as the ...
0
votes
1answer
105 views

no_results not working when moved to snippet

I have moved embed code to be a snippet. After that move no_results stopped to work (part of the code below) {exp:channel:entries channel="products" category="{segment_2_category_id}" orderby="title" ...
1
vote
2answers
370 views

Switchee segment check in embedded template not working

I'm new to Stash and Switchee and this is probably a parse order issue, but I am not quite sure how. Maybe someone that understands this and Switchee a bit more is able and wouldn't mind explaining ...
0
votes
2answers
264 views

Using switchee to detect pagination

I'm using Switchee to detect pagination. Switchee is working fine for: /new/PX/ I also use Zoo Triggers for categories and archives and have the following pagination URL's too: /news/category/abc/...
1
vote
3answers
563 views

Conditional Not Working

I'm having some problems with my view model template... I'm trying to compare the value of url_title, but regardless of the value of it the last conditional passes and sets the stash variable... This ...
1
vote
2answers
276 views

Conditional Plugins: Switchee & IfElse

I have some simple conditionals mixed with some advanced conditionals. I've just downloaded Switchee and IfElse and am trying to figure out which plugin is best for each situation. Can someone help ...
2
votes
1answer
454 views

How to use Switchee

I am unable to get Switchee to work. I have installed the Switchee 2.0.6 with ExpressionEngine 2.5.2. Here is the conditional statement that I'd like to use, where "champions" is a custom field: {if ...
1
vote
2answers
193 views

Switchee with multiple stash variables only evaluates first variable

I have the following code: {exp:switchee variable="{exp:stash:get name='custom_sidebar_text'}/{exp:stash:get_list name='related_articles'}/{exp:stash:get_list name='related_events'}" parse="...
3
votes
1answer
85 views

Uneven category depths template

I have a site where there is an uneven depth of categories for a product channel. Previously I've cobbled together a band-aid solution but I'm reaching out to see if there is a better way. I have a ...
0
votes
1answer
46 views

switchee code not outputting data

This is the first time i've used Switchee and it's not outputting anything. The code looks correct. Any thoughts? gallery_type is a P&T Switch field. (I've simplified the code for sake of the ...
2
votes
2answers
127 views

Site uses switchee to serve index or 'static' page; Now getting unexpected 404s

My site's index page template uses switchee to determine whether to serve up index (home) page or a "single page" entry from the static channel. I'm attempting to set up a 404 page for the site, and ...
1
vote
2answers
150 views

Switchee not working

i simply cant make a simple switchee condition works...just to load template snippet, with different sizes/css. Help, please? (My first time with Switchee) <!-- switchee via simple text field --&...
0
votes
1answer
331 views

Switchee, Stash, Low Variables, Playa and Parse Order

I’m curious about a parse order issue I’m running into with Low Variables and Stash. I have a client site that’s using Switchee, Stash, Low Variables and Playa. I am able to retrieve the custom ...
0
votes
2answers
276 views

Changing site_url on the fly

We're revamping a site that has a url structure of http://mysite.com/partner_name. When that first segment matches a partner name, their current custom site changes all urls and logo. In our case on ...
0
votes
0answers
139 views

Playa's {myfield:total_children} and conditionals (checking for “no results”)?

We are using EE 2.5.5 and Playa 4.4.2. We are setting the "status" field dynamically on our site. We need to be able to use Playa like so: {if {myfield:total_children status="{embed:status}"}}{/if} ...
0
votes
3answers
273 views

conditionals using switchee

I was wondering if someone can tell me how to approach this. I have some code that runs through all available entries within a channel and determine if its a match to the pre-determined variable. I ...
1
vote
1answer
229 views

Exit if condition found - updated

In this case I'm using switchee to test if a product exists in a cartthrob order (could be 1 item or 100 in the order) and should a particular product be found then load a snippet. The issue is the ...
7
votes
1answer
533 views

Stash, switchee and template caching outputs a random string {6ee64145dfa4ae5926a9c326266d5954499133923}

I am using EE's next_entry tag to link to the next entry, and then using a stash/switchee combination to evaluate if we are at the last entry in the loop and if so use a channel entries loop to ...
1
vote
0answers
57 views

Pages module affect use of category url indicator?

Putting together a blog template, using switchee to create all the related templates within the one. I have 'Yes' selected for 'Use Category URL Titles In Links' and category is my reserve word. My ...
2
votes
2answers
102 views

Switchee | Matrix and MX Calculator

I'm trying to use MX Calculate to perform a percentage calculation of each row in a matrix column and the percentage is based on the value that's in each row which I'm trying to get Switchee to ...
4
votes
1answer
580 views

SEO Lite & Switchee

OK, so i've had a great deal of help on here on the rebuild of my site, and I'm onto the last part which is to make sure my pages meta, titles etc are working well. I have switched (pun) a lot of my ...
0
votes
0answers
205 views

Low Variables with Switchee - parse order issue

Hi I'm having a parse order issue that I can't seem to figure out. I have a template that looks like this: some code here <div class="content-line"> {exp:low_variables:parse var="lv-...
4
votes
1answer
197 views

Changing the url structure of established site?

Just a quick question regarding the URL (template) structures in expression engine. I have an established site that has been live for almost a year. I was brand new to EE when I set up and therefore ...
1
vote
1answer
223 views

Stash Get not getting, but Stash Set output=“yes” shows data?

I'm having a bit of an issue in repurposing a functioning template of mine. I have a {exp:stash:set} and {stash:get tag}, both of which worked on the previous template, but on this new template which ...
3
votes
2answers
247 views

Page title incorrect on stash paginated results

I'm using Stash and Switchee to build some paginated News entries. However, when I click through to Page 2 and beyond, my page title changes to the latest entry in the CMS. Wondered if anyone had a ...