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

learn more… | top users | synonyms

1
vote
1answer
22 views

Use conditional to check that the current user is the author of the post

How can I check that the current user is the author of the post? Something like this?... {if author_id="CURRENT_USER"}{/if} (My setup is basically an entries loop, with a snippet inside of that ...
0
votes
0answers
4 views

Contains Conditional throwing PHP Warning

Using Taxonomy, we can add css classes to the list item. I want to check if the "open" class is among the classes listed, but I get this error (only when logged into the system): A PHP Error was ...
0
votes
1answer
12 views

Compare url segment and category name with conditional

I'm trying to write a conditional so that the I can output an active css class when the url segment is the same as the category name. Because the url segment includes dashes between each word and ...
0
votes
1answer
23 views

Conditionals using current time format

does anyone know why this code will not display correctly? It looks right to me. {if "{current_time format='%d.%m'}" >= "06.11" && "{current_time format='%d.%m'}" <= "07.01"} 6 Jan ...
0
votes
1answer
13 views

Add active class to Solspace Tag list

I have a list of tags on my site and want to add an active class to the linked tag based on the URL. For example, if the user is on the URL http://whatever.com/blog/by_tag/control+system+failure, I ...
0
votes
1answer
24 views

Date conditionals not working as they should

Im using this code which as of todays date should display 11 Sept but instead it displays 20 Feb?? Cant figure out what is wrong {if {current_time format="%d.%m"} >= 06.11 && {current_time ...
0
votes
2answers
14 views

Solspace Calendar - Occurrence

I have two different types of events that show up on the same template. If the event is a multi-day event, I classify it as such using a category. If it is a single day event, it is classified as ...
1
vote
2answers
32 views

EE Conditionals failing due to '' and “”

I have this conditional: {if '{spieldaten_datum:first unit="month"}' == 'y'} Blabla whatever {/if} On my mamp environment with php 5.5.10 it all looks fine. On my live Server with php 5.5.26 a ...
0
votes
2answers
18 views

IF conditional using segment_url leave a blank space in text

In creating page titles based on URL segments (for list pages), we have utilized conditionals that point to the segment urls for conditional inclusion. HOWEVER when the page source is viewed (and the ...
0
votes
1answer
18 views

Conditional Statements to show Open Hours

So I want to show "Open-Now" if the current time is in betwee in the open hours (which are put in a grid time select field). This is what I have right now: {if {current_time format="%h"} >= ...
0
votes
1answer
32 views

Conditional Not Working

I have an events listings. Events are by “start_date”. When I have no events I want to display “NO EVENTS SCHEDULED” When I have events I want to remove the NO EVENTS SCHEDULED. I can’t seem to get ...
0
votes
2answers
24 views

Can't do “if” conditional with FreeForm field unless I output the field elsewhere?

Inside an {exp:freeform:entries} tag, I can't do something like {if freeform:count == 1} unless I output {freeform:count} somewhere in the loop. It can be above or below the conditional. Doesn't ...
0
votes
1answer
27 views

How do I check for a null or blank snippet?

I want to have some fallback text for when a snippet isn't available. I tried this: {if '{snip-start-to-end-dates}' != ""} {snip-start-to-end-dates} {if:else} Long-term Installation {/if} ...
1
vote
1answer
26 views

Conditional logic inside of <script> tags

Having issues trying to wrap logic inside of <script> tags, it seems my "if/else" statements get printed instead of parsed? As an example, if I do something like: {exp:query sql="SELECT ...
0
votes
0answers
10 views

Conditional for grid / file - thinks file exists after having been removed

I am using a conditional to display a snippet whether a file has been uploaded to a grid field - mentioned here: Grid conditional for a file(s) - If file exists display content (file) {if files} ...
0
votes
2answers
31 views

Grid conditional for a file(s) - If file exists display content (file)

I have a grid field (files), with a column/variable (file). I just need to display my content/snippet if a file has been uploaded. So something like: {if files:file}link to my file{/if} Any help ...
1
vote
1answer
36 views

Wish a bit help with conditionals and operators

Im trying to show results after search so that if there is under 10, it shows A, but if there is more than 10 results, it shows B. But I dont understand how to make this happen. I tried this but it ...
0
votes
1answer
59 views

How to use page transitions with Expression Engine

I'm trying to use page transitions using smoothstate.js (http://miguel-perez.github.io/smoothState.js/). What this appears to do is to load the destination of a link in the background when the link ...
0
votes
2answers
38 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
33 views

Display entry title related to (channel images) image if exists

I have a channel named Projects, and within that channel i have a 'channel images' field (p_feature). It allow the user to upload one image, and if they do so that image will appear on the Home page ...
0
votes
2answers
27 views

How do I check for an empty field in a child entry?

I have an Event entry which can has one child Location entry. The Location entry has two fields: Title and Floor. Sometimes floor is empty so I'm doing this in my template to see if there's a floor ...
0
votes
1answer
24 views

conditional to evaluate structure (url) field and current_url

I'm trying to create a conditional to determine if the structure entry url is the same as the global {current_url}. I created a structure field called, {product_category}. For some reason I cannot get ...
0
votes
2answers
18 views

Search module giving incorrect links

I'm setting up a search feature on a site and one of the channels that it's searching is downloads. Rather than link all download results to the downloads page using the {auto_path} tag and then ...
0
votes
0answers
45 views

Relationships and conditional problems

I have a Facilities channel and a Jobs channel. The Facilities entries have multiple fields with facility info. The Jobs channel has a title field and a relationship field that allows a user to select ...
1
vote
2answers
54 views

Simple Conditional Help

Simple question here hopefully. I have an album page that displays a track listing. With the option for up to 4 discs being displayed as show below. DISC 1 Track listing DISC 2 Track listing ...
1
vote
0answers
34 views

Using session_variables and conditionals with Matrix!

The Situation: I'm building a new feature for a wildlife-based charity. They want to spice up their donation form to include images of relevant animals based on how users have been browsing the site. ...
2
votes
1answer
109 views

Conditionals from within Piped String of values

I have a string of piped category ID's which represent all the categories which are selected for any given page. Within my page, I now need to check the input of the chosen categories. For example, ...
0
votes
1answer
17 views

Check existance of layout variable?

Is it possible to do something like the following (which doesn't work). {if layout:contents} {layout:contents} {if:else} 404! {/if} thanks! :: ed
0
votes
0answers
18 views

Basing a conditional on Grid's next_row

I've got a grid field that contains a field (column) called 'flagfield'. I'm trying to find a way to have a conditional inside the main Grid loop based on the value of flagfield in the next row. ...
1
vote
2answers
50 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
3answers
64 views

Using conditional for displaying special content to specific entry

Trying to display different link for one entry (thing1) inside channel entries loop. {exp:channel:entries channel=“things”} <h2>{title}</h2> <p>{description}</p> ...
1
vote
1answer
25 views

How do I limit content display based on Categories selected?

Under most circumstances this would be an easy answer, but I have a slightly trickier segment I am working with. The following code displays the category names if they are selected in the entry: ...
1
vote
1answer
83 views

“Invalid Conditional” error if relationship :count is 0 in conditional?

I'm getting an error if my relationship field does not have any related entries selected: You have an invalid conditional in your template. Please review your conditionals for an unclosed ...
0
votes
1answer
39 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
0answers
24 views

Conditional to detect entries with the same values?

I'm trying to write a conditional to detect if there are multiple entries with the same value in a specific field. If there's more than one entry with the same value in this specific field, I'd like ...
0
votes
1answer
32 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
34 views

How do I write a conditional based on search results?

I have a section set up to display contents based on category URL information and it works great. However, when I do a search, the search result URL has a unique value in segment_4 that doesn't fit ...
0
votes
1answer
68 views

no_parents/no_results Using playa entry results based on a url segment, want to display no results

I have a list that builds based on the URL segment. Sometimes there no entries for the segment and need to display "no results". I have tried several varations on this and nothing seems to work. Any ...
0
votes
1answer
21 views

Playa field with the same data

I have a playa field into an entrie for a channel written by teachers. I'd like to prevent when a teacher uploads the same 'link' multiple time in different lessons that the 'link' is NOT shown ...
0
votes
3answers
165 views

Grid Conditionals not working

I'm using a simple grid conditional to show academic references in a post. I only want to show it if someone has entered some references, but the conditional just isn't working. What am I doing wrong? ...
0
votes
1answer
47 views

any conditional causes fatal error

This is probably only partly related to ee and more to do with server setup but I am hoping someone can help. Adding any conditional to my templates results in the following error: Fatal error: Call ...
0
votes
0answers
29 views

How to set a modifier to adjust the price based on quantity ordered

OK - so apologies if this turns out to be a lengthy post, there's a bit to explain! My client sells pens, branded pens with a logo... They have 5 things that affect the end price of each product ...
0
votes
0answers
21 views

Conditional freeform reply if email input contains domain

I'm wanting to know if it is possible to set-up a condition in the automated reply Solspace Freeform email template that sends content "A" if the email address they enter in the corresponding field ...
0
votes
1answer
39 views

If statement failing in with custom field on a specific post with certain value length

A very weird problem, but in a specific channel that has many custom fields I get a very peculiar problem with just one entry (as far as I can tell) where a particular custom field is failing only ...
1
vote
2answers
115 views

How to hide content if channel has no entries?

A found a few questions related to this one. However, the solution they provide is not compatible with my situation. How do I hide a div when the channel entries tag it contains has no results? ...
0
votes
1answer
21 views

Error after EE2.9 update. Conditional fix required

The below code no longer works with EE2.9 Have tried determining how to change it but cannot work it out. I just need to specify that if ANY of the fields exist, display the content ...
0
votes
1answer
77 views

Conditional to check if a field exists for a channel

Is there a way to check if a field with a certain short name exists for a given channel? I'm not checking if a field is left blank, but if it even exists in the field group. Currently, this only ...
0
votes
1answer
146 views

Conditional Breaks after 2.9 upgrade

I was successfully using the following block of code until I upgraded to EE 2.9.0. {exp:query sql="SELECT COUNT( * ) AS itemCount FROM exp_freeform_form_entries_4 WHERE form_field_52 = 'yes'"} ...
0
votes
0answers
75 views

Solspace Freeform Pro Conditional Fields

I'd like a user to select a method of payment, and based on their selection, have 2 things happen. Show text field "member_number" and on Submit send user to a specific page. Show text field ...
0
votes
1answer
23 views

Categories not selected correctly with if statements

Currently I'm trying to use if statements to determine what category to filter on. I'm using a combination of freebie and embed. However, I can't seem to find the right syntax to filter correctly. I ...