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 [ifelse]

The tag has no usage guidance.

2
votes
1answer
34 views

'If' conditional statement not working, returning PHP error

I am using EE v2.5 and following the documentation from https://docs.expressionengine.com/v2/templates/conditionals.html I am trying to create an If Statement where if the Channel field labelled '...
2
votes
1answer
50 views

How To Create Headers For A List

I have a list of items. Each item has a season. I am trying to organize the items by season. I believe the list is pre sorted and I need to create a header everytime there item has a new season In ...
1
vote
3answers
90 views

Setting a Stash variable within an old style EE conditional

I'm working on an old EE site (v2.5.2) which for reasons I won't go into I cannot update to a newer version. I am trying to set a Stash variable based on whether or not a condition evaluates to true. ...
0
votes
1answer
26 views

Checking the channel in the channel entries tag

What I am trying to do is combine the output of 2 channels. They both have an image with a different name so I am trying to check the channel to determine the which image I need to output. Code below. ...
1
vote
1answer
43 views

Conditional if else Problem

I have an additional title called {long_titles}, but do not use it for every entry. However, when I do use it, I want to suppress the {title}. I have tried several approaches but can't get it. Needs ...
0
votes
1answer
59 views

If statement when layout variable contains whitespace

I'm using an if statement in a layout to check if a layout variable contains any content. {if layout:sidebar} <div class="sidebar"> {layout:sidebar} </div> {/if} This works well ...
0
votes
1answer
34 views

'IF' Conditional Not Working

I want to set up a conditional that when correctly running will post a 'widget' on the sidebar based on the entry. I have eight events (concerts) and three venues. On the individual detail page, I ...
0
votes
2answers
47 views

Conditional {if} and {if:else} Getting Error Message

I get an error message each time. "You have an invalid conditional in your template. Please review your conditionals for an unclosed string, invalid operators, a missing }, or a missing {/if}." Stuck ...
0
votes
1answer
21 views

Conditional with if and ifelse not working

Every entry has one image {event_feature_image_01}, however, some entries have a second, third and forth image. I want to count backwards from the forth image {event_feature_image_04}. Every entry has ...
0
votes
1answer
97 views

EE 2.5.5 how to use snippet in if statement

I have a multi site EE set up and I have set up a snippet to use in my template. The snippet syntax is {current_site_name} and the content that the snippet outputs is {site_name} I am trying to use ...
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 ...
1
vote
0answers
61 views

List entries grouped by field value and category

I have a channel (products) where each entry has only one category. Each entry also has a custom field (year) which stores a year value (e.g. 2015). The output I currently have looks like this (note ...
0
votes
2answers
126 views

filter output with a loop: if {entry_id} not in array

Within a loop, I need to output different info according to whether an entry is in an array of id's or not. I currently get the id's from a query on the matrix table. So I need something like this: ...
0
votes
1answer
64 views

Conditional Comparison Operator Not Working With Snippet

I am trying to get a snippet that calculates a value and compare the result to a number - the value is correctly outputted from my snippet when I include the var by itself. However when I use the ...
0
votes
2answers
79 views

Conditional statement syntax

I am working on an Expressionengine site at the moment, the client would like the ability to choose if there's a custom phone number in the sidebar of the page and if non is entered it just shows the ...
0
votes
1answer
63 views

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

Channels and Fields Summary: Tours channel - stores a list of all Vacations the site offers tour_specials field - a Playa field, linked to the Specials channel indicating which Special Offers apply ...
1
vote
2answers
251 views

If statement based on length of Channel Field

Is it possible to create an {if} statement based on the character length of a channel field? Something along the lines of this: Lets say I have the channel field - {title} and I want to add a class ...
0
votes
1answer
46 views

Conditional statement issues

EE v2.4.0 (Updating is not an option at this time) Hello! The photo gallery that we use still shows up even when no photos are added. Basically what I'm trying to do is get the image gallery to show ...
0
votes
1answer
51 views

Evaluate two conditionals for content

I have a page where I want to display either a featured image or an image gallery in the left corner of a text block, which wraps around the image. Pretty basic. If I use just a single image for the ...
0
votes
2answers
74 views

Is there a layout switcher in EE2?

Ok so I have this dreamweaver extension called tab panel menu where each menu I can generate either a single column, 2 column, 3 column, 4 column, 5 column or sub menu. Now I wish to make use of this ...
0
votes
1answer
39 views

Counting Results Outside Channel Tag

I have this peice of code: <div id="slide-block1" class="flexslider"> <div class="slides"> {exp:channel:entries channel="rotator-slides" ...
0
votes
1answer
58 views

Is still necessary using the Add-on Ifelse from Mark Croxton with EE2.9?

In the new EE version (2.9), the conditionals evaluate when ready, so the performances are boosted. Is still necessary using the IfElse Add-on from Mark Croxton, when using EE conditional?
0
votes
1answer
181 views

If else condition involving contains on url-title?

I have an event block that displays images. I want to have 3 options: - if event has image, display that image - if event url title has a certain keyword, display that image - else display a ...
1
vote
2answers
69 views

If statement parentheses not working correctly

I've got a weird issue with parentheses in an if statement. If I have the if statement on it's own then no content is shown. If, however, I place two if statements in front of it then everything works ...
2
votes
3answers
165 views

Advanced Conditions: {if:else} tag not getting read

So, I think I've caught on that advanced conditions and EE tags don't play like expected. So, I downloaded Mark C's "IfElse" plugin and things are looking up. However, my default condition, doesn'...
1
vote
1answer
28 views

changing permissions on certain categories

I have a page that hides some amount of page content for free viewers. We have a certain category of 'sample' articles which should be available for everyone. Is there an if clause which basically ...
0
votes
1answer
84 views

Weird If statement behaviour inside channel:form

I'm building a page containing a channel form to allow users to edit their posts, and I thought I'd add an {if}...{/if} statement to prevent them editing other users' entries. The permissions on the ...
1
vote
1answer
109 views

If condition for phpstringfun or streng?

I want to find if a string contains a word ot not? It is a pretty simple thing if i want to do it in php.But When it comes to EE you need some plugins to do the job of strpos. I have two plugins ...
0
votes
1answer
561 views

category id with if:else statement

Basically im looking to show alternate images depending on the category id. Below I have shown my code, which doesnt work, but I would appreciate any information that any one could give me please! ...
0
votes
4answers
1k views

nested if statements - a better way

I have nested if statement for template selection - seems a bit cumbersome is there a better way? {if member_group == 5 } {if last_segment == "edit" } {embed="mypassport/...
1
vote
3answers
38 views

detect data is coming from which channel?

{exp:channel:entries channel="schedule_action | schedule_sports | schedule_hd" } //how do i detect channel here.I need to use a if condition. {/exp:channel:entries} ...
0
votes
1answer
927 views

If custom channel field entry exists display content else display alternate content

I am trying to set up a slider in ExpressionEngine which will display a video if the video embed code exists, otherwise it will display an image slider. Currently, I am not able to hide the image ...
1
vote
1answer
295 views

Syntax error, unexpected T_ENDIF

I have the following code in my templates: {exp:channel:entries channel="cover" limit="5"} {if total_results > 1}More than one{/if} {covervid_bg_video limit="1"}{file:url}{/...
1
vote
1answer
193 views

Condition if entries exist?

My markup: <section id="box"> <ul id="slide"> <li></li> <li></li> <li></li> </ul> </section> I want to show the section box only if date ...
2
votes
1answer
149 views

If statement on segment eq url_title - strange behavior

My goal was to mark current/active article on the list. Code looks like: <ul class="list-plain"> {exp:channel:entries channel="products" category="{segment_3_category_id}" orderby="title" sort="...
0
votes
1answer
114 views

If not conditional not behaving as expected (== works, != doesn't)

I'm using DevDemon Forms, on two of my pages, which requires that jquery be included in the the document head. On other pages however, I want to include jquery in the footer. So i thought I would ...
0
votes
2answers
99 views

Having embeded include use channel fields

I am using BrilliantRetail and on my product page, I have tabs with different information about the products. The code for the tabs is pretty long so I would like to make it an include and then embed ...
0
votes
1answer
73 views

Wygwam if conditional

Basically i want to know if its possible for expression engines if tag to check if a wygwam field contains images. I know its possible to pull through just images like so: {my_wygwam_field ...
1
vote
1answer
105 views

Compare contents of two grid inputs, possibly with variables?

I have two grid inputs and I need to have a conditional statement that says: if all fields of both grids are equal to 0, output some text. The way I'm trying to do this is by changing a variable value ...
0
votes
1answer
150 views

Checking If tags has content or not

I want to check if two tags have content in them, and set html markup accordingly. And I reuse this snippet several places and I'm having inconsistent results. {if site_hvite_left == "" OR ...
4
votes
3answers
284 views

If statement inside a loop?

I am using the store finder module, and am trying to insert a "title" for each "state". If I have 20 stores in a certain state, I would only like to display the "title" once. Is there any way 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
2answers
67 views

How to only execute some code within a specific time frame?

I have a site where users can use a SafeCracker form to submit an entry. Once they submit the entry, they are taken to a confirmation page that also includes some code to automatically send out a ...
1
vote
2answers
146 views

if 2 channels on one page ie: if channel == “channel1”

I am trying to display one entry (most recent) on my home page from 2 different channels. So ChannelA and ChannelB. {exp:weblog:entries weblog="weblogA|weblogB" limit="1" sort="asc" ...
3
votes
2answers
386 views

Stash set_list not displaying channel entry loop

I'm having trouble displaying a channel entry loop within my EE setup which uses the Stash and IfElse modules. First of all, see this screenshot of my file structure: I'm using the 'partials approach'...
1
vote
0answers
60 views

How deep into a Matrix field type can I go with IF statements?

Bear with me as I explain my setup... I have a channel called Speaker and a channel field called speaker_media that is a matrix field type. Inside the matrix I have a channel field for speaker_audio, ...
0
votes
2answers
75 views

Is this a parsing issue with advanced conditionals?

I have a header snippet that includes a "Made in USA" image on it. Well the client now wants the image removed on a couple product pages. I setup an advanced conditional to check for those pages using ...
1
vote
1answer
67 views

Playa fields: can I pair one channel entry to another and populate similar channel fields in template?

I'm an EE novice working on a big site. I have a configuration concept in my head and I want to know if it's doable. Please bear with my limited knowledge of EE lingo. I'm still learning. So I have a ...
2
votes
1answer
154 views

Wrapping a query in a logic statement

I didn't think this would give me any trouble, but it is. I just want to run a query depending on the URL segments. I have this now: {if segment_3 != ''} {exp:query sql="SELECT a....
1
vote
2answers
54 views

How to check if EE member has a website address (field carries http:// so it always returns true )

I have the following code: {if url} <p><strong>Website</strong><br /> <a target="_blank" href="{url}">{company_name}</a></p> <hr /> {/if} ...