Hot answers tagged

4 votes
Accepted

Conditional if else Problem

Try this: <h3> {if long_titles} {long_titles} {if:else} {title} {/if} </h3>
  • 5,900
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 '...
  • 17.4k
2 votes

Conditional statement issues

If I read your code correctly, you use Matrix field to keep images. Try next code for this: <div class="left article_image"> {if article_images:total_rows>0} <ul data-orbit> ...
  • 5,781
2 votes

Is there a layout switcher in EE2?

If I understood what you want, maybe one of these add-ons can help you: Entry Type - A dropdown fieldtype that shows/hides other fields on the publish page; Better Pages - Better Pages is an ...
  • 6,108
2 votes
Accepted

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

It depends. If you aren't using variables on conditional outside the default order, you can remove ifElse. For example, ifElse parses early variables like member_id and group_id. Take some time to ...
  • 6,108
2 votes

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

You cannot close your exp:channel:entries-tag in a branch of the if-structure, because in case you have a banner (first branch) you finish the channel-loop and will not get to the end of the if-...
  • 460
2 votes
Accepted

Checking the channel in the channel entries tag

try using channel_short_name == "work" You can find the short name in the list of channels. Also in your channel tag, you'll need to specify both channels. channel="work|latest"
  • 1,987
1 vote
Accepted

'IF' Conditional Not Working

It needs to look like this: {if segment_3 == "opening_night_concert1" XOR segment_3 == "the_greats" XOR segment_3 == "a_woodwind_affair"}
  • 1,987
1 vote
Accepted

Conditional with if and ifelse not working

Option 1 - show nothing at all if there is no image: {if event_feature_image_04 OR event_feature_image_03 OR event_feature_image_02 OR event_feature_image_01} <img class="img-responsive ...
  • 3,572
1 vote
Accepted

EE 2.5.5 how to use snippet in if statement

If you look at the parse order of the template engine, you'll see that although snippets do get parsed before conditionals, standard global variables (which includes {site_name}) don't get parsed ...
  • 17.4k
1 vote

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

If your goal is separate these specific entries and output them differently, use categories. You can then have content editors easily select (from the entry_form) entries that should be treated as ...
  • 5,900
1 vote
Accepted

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

Are you using version 2.9+? Which is the separator? Let's pretend you're and the separator is ,, giving you something like 1,2,3,4,5. Let's use the contains and the concatenation operators. Using ...
  • 6,108
1 vote

If else condition involving contains on url-title?

You need some RegEx for that. Using the new conditionals operators of EECMS version 2.9: {if event_photo} {exp:imgsizer:size src="{event_photo}" alt="{title}" width="300" height="450" class="...
  • 6,108
1 vote
Accepted

If statement parentheses not working correctly

It seems as though the conditions inside the parentheses don't need the curly braces. At least this has fixed it for me. {if (downloads:total_rows > 0 || section_2:total_rows == 1) && {...

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