For questions that use logic to display or hide parts of a page/template

learn more… | top users | synonyms

0
votes
1answer
22 views

If statements using OR and Matrix fields

I have a Matrix field that includes three options. The aim is to output a <select> element if one or more of these options is selected. (These fields are Pixel & Tonic Field Pack ...
0
votes
1answer
16 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 ...
0
votes
1answer
15 views

Trouble with Conditional inside Matrix Field

I'm trying to setup a conditional to only show the Start Date when the Start Date and End Date match, but I can't get it to work in Matrix and I can't find a similar question anywhere. Here's what I ...
0
votes
1answer
28 views

Playa in a Low Variable and Stash problems after Update to latest stable Stash version

I had this scenario working before: A Stash "standard.hmtl" template with {exp:stash:get name="maincontent"} A single-view template for products that looks like this: {!-- set the page layout --} ...
0
votes
1answer
11 views

Frontend public message with close or hide button

I'm looking for a way to display entries from a channel as a message on the homepage that are able to be hidden once the visitor has read it. Anyone know of a simple way to achieve this or an add-on ...
0
votes
3answers
20 views

Showing Channel Image gallery IF there's more than 1 images?

How to show a channel image gallery if there is more than 1 images inside? {exp:channel:entries channel="journal" limit="1" url_title="{segment_3}" ...
0
votes
1answer
17 views

custom field not blank conditional issue

I've created the following conditional which is displaying 0 content: {exp:channel:entries channel="patterns" orderby="title" status="pending|camera-ready|closed|open"} {if oldnotes != "" } ...
0
votes
1answer
32 views

If {there is no image} OR {if there is no expert} then use a certain image

Here in this code I am finding a feed expert and then producing his avatar. Conditions are needed to control the conditions of this avatar output. So this is what must happen: firstly if there is a ...
0
votes
3answers
36 views

using URL parmater with conditional

Inside this URL there is a parameter: http://localhost/recipe?id=9 Is it possible to use this parameter (id=9) with a conditional, like a segment? Or to check if there is a parameter inside a URL ...
1
vote
1answer
21 views

Simple conditional to compare expiration and entry date failing to evaluate

I'm trying to code more readable dates on posts which have been entered. It will read "12 - 17 Jan" but if the month is across two months it will read "12 Jan - 2 Feb" Spitting out my dates like so ...
0
votes
2answers
23 views

parent total count playa conditional

Hey I am trying to use conditionals with Playa. I can't seem to get the following code to work {if {exp:playa:total_parents channel='listing'} > '0'} <section class="listing-cards"> ...
1
vote
3answers
22 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
33 views

Parent Relationship Conditional — if not empty

I have had no luck in trying to sort a conditional that will only show the following if the category is not empty for the parent relationship. <h3>ARTICLES</h3> {parents orderby="date" ...
0
votes
1answer
18 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
2answers
41 views

conditional based on what channel the entry selected in a playa field is in?

I have a matrix field that has 1 column, which is a playa field. The playa field is set up to allow the user to choose any open entry within 2 different channels. I need to display code in the ...
0
votes
0answers
23 views

Why is this comparison check not working on a Windows box?

I've set up the following code on a site. On my Mac (dev version - identical to the running live code) the template looks like this: {if '{current_path}'=='/'} ... {/if} And this works fine. But ...
1
vote
1answer
35 views

if last segment equals url title

I am trying to show an active class if an entry is being viewed but my conditional's are not working: {if last_segment == '{url_title'} class="active" {/if} I am using an embed of a list of ...
1
vote
1answer
41 views

How do I use a conditional to display Relationships content?

I am working with three Relationship fields and I would like to be able to display a section only if there are any related articles in that section. I tried this without success: {if related_tips != ...
1
vote
1answer
30 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 ...
0
votes
0answers
29 views

Use conditional to hide or show entry

I would like to use a conditional to hide or show information from an entry. The following code is pulling in data from an EE relationship field. If there is no entry I would like this code NOT to ...
0
votes
1answer
35 views

how to put a category condition with exp:query?

{exp:query sql="my query"} {/exp:query}. This works fine.But I want to give a category condition to it.When I do it,it does not flter the data accordingly. for example: {exp:entrie:channel ...
1
vote
1answer
29 views

Comparing Stash variable to segment fails

I asked this also on Devotee - apologies for posting in both places but I guess here is better. I’m setting several variables in the Channel Entries loop like so: {exp:stash:set name="var1" ...
3
votes
2answers
79 views

Page Load too Slow

I have a page template that runs exceptionally slow (average 20 seconds to load). These pages are event pages and require certain information to be shown pre-event vs. post event. There are also ...
2
votes
1answer
43 views

Simple conditional statement and parse order problem

I'm fairly new to ExpressionEngine, and I hope the problem I'm running into is a simple one to solve. I'll try to illustrate it as best as possible: I have a radio button field (created within a ...
1
vote
1answer
32 views

Conditionals not Parsed in form

I am creating a form via module, that I wish to use for both insert and update. After the insert user has the option of going back to edit the values previously input. The issue that I encounter is ...
1
vote
1answer
25 views

Anyone know of a plugin to show Category count?

Basically want to find the number of entries per category in order to perform a conditional to show different content based on the entry count. Essentially: if count = 2 then this if count is less ...
2
votes
1answer
59 views

Google indexing weird EE URL's

One of our clients is having a problem with Google indexing incorrect URL's. The shop templates are using something like... {if segment_2 != "" AND segment_3 == "" AND segment_4 == ""} Parent ...
1
vote
1answer
54 views

Can't get my conditional to work inside a Playa field

I want to insert a simple exception, using an "if" statement, into the flow of my Playa field's output. But it's not working. Can I get help? Here's the code that works: {prac_area_contact_people ...
1
vote
2answers
59 views

Stash Destroys variable regardless of conditional

I have the following at the top of one of my pages: {if "{fn_zone}"!=""} {redirect="/store"} {if:else} {exp:stash:destroy name="delivery_day"} .... More stuff .... {/if} However, what I'm ...
1
vote
3answers
93 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
31 views

{count} of shown/rendered channel entries passed through conditionals

When I display a couple of entries using the channel tag, and use the {count} var inside the entries template, I simply get 1,2,3,4 etc. When I use a conditional to filter entries like so: ...
0
votes
2answers
62 views

Detecting Server Environment in Template - {site_url} Conditional Fails

Problem: Include analytic JS code in production, but not in staging or development. Attempted to detect production environment with: {if "{site_url}" == "http://www.example.com/"} ... but that's ...
1
vote
2answers
62 views

Conditional not evaluating as expected

I have this conditional {if '{logged_in_group_id}' == '{exp:config_variables:get name="xxxxx"}'}... where {logged_in_group_id} is equal to 3 and {exp:config_variables:get name="xxxxx"} is equal to ...
0
votes
1answer
43 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 ...
2
votes
1answer
32 views

Can we use member_group instead of logged_in/out?

I am creating a members only section and I am wondering if I can use the member_group variable, on its own, to check if a user is logged in or not. My assumption is that using both the logged_in ...
2
votes
2answers
34 views

How to use negation with a boolean in a tag?

I am writing a plugin, and everything is working fine so far. Some of my source data includes booleans. So I want to be able to test for a value of false. This is the plugin code. $array = ...
2
votes
2answers
165 views

Conditional Variable with Grid Field

I've got a navigation structure where I'm using the Title as the main navigation menu item and then using grid for any submenu items. So what I basically want to do is something like this: {if ...
1
vote
1answer
82 views

Using if logged_id & auther_id=“CURRENT_USER” creating scattered results

I'm trying to use if logged_id & auther_id="CURRENT_USER" to load a specific entry back to users. However I'm seeing mixed results. I'm using EE 2.5.2 and Safecracker and have had success with ...
2
votes
2answers
205 views

Check if category is assigned in channel entry conditional

I am trying to use templates in embeds depending on the users' category selection but I don't know how to check if a category has been assigned or not. {categories} {if ...
0
votes
1answer
52 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 ...
1
vote
2answers
41 views

Possible to do conditionals on embeds?

Is it possible to do conditionals for embeds? For example,lets say I have this very simple template, test/foo {if foo} yes {if:else} no {/if} In other templates, I want to use this embed in a ...
2
votes
2answers
110 views

Conditional not working as expected

I have this code {exp:low_replace find="\r|\n|\t" replace="" regex="yes"} {if '{member_group}' == 7} aaa {if:else} zzz {/if} {if '{logged_in_member_group}' != 7} ...
0
votes
1answer
78 views

How to test P&T's field pack checkbox, unchecked

I want to test for a single unchecked checkbox using P&T's field pack checkbox. Anyone know the syntax for this?
0
votes
0answers
37 views

PHP error if no image in matix field

EE2.5.2 I have a Matrix field with 2 columns. First column is a safecracker field with some image transforms on the file upload location to create a few different size images. Second field is a text ...
0
votes
3answers
63 views

Can I do this with conditionals

Hi I'm looking for a way to repeat this process to build a title with conditionals In the php version of my site I can use the following if (!empty($PostKeyword)) { $PostTitle = $PostKeyword." ...
2
votes
2answers
112 views

Conditionals inside Channel Entries tag to determine whether a second tag is required

Current Setup I have 5 entries in the "internal_ads" channel that rotate on the homepage. I have set up a category of "urgent" that has 1 entry in it. I'm using stash to set a list of adverts, then ...
2
votes
1answer
178 views

Stash list, conditionals, and {count}

I'm using Stash lists to output channel entries grouped by the value of a custom field. In this case the custom field is a relationship field, but that's not relevant because the actual entries output ...
2
votes
2answers
44 views

Place article_images inside a div only if there's more than 1?

Pretty new to ExpressionEngine, so please excuse my lack of knowledge. I have a site where I want to use a slider on pages with more than one article image. The way I have it set up now works fine for ...
3
votes
1answer
328 views

Conditional for empty relationships field

I’ve run into an issue where I need to conditionally show content if an EE relationship field is empty. However the {if relationship-field} conditional is not working. Nor is any variation of that ...
1
vote
3answers
164 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 ...