For questions that use logic to display or hide parts of a page/template
0
votes
3answers
35 views
When selecting channel entries, only select entries in just the top-level category
I have a channel with entries in categories and subcategories. I want to output a list of only the entries that are not in the subcategories. Is there a way to do an "only A" or "A & not anything ...
0
votes
1answer
18 views
Get current category of channel entry corresponding to current URL
I have a channel, products, with a URL structure like this:
/product/description/categoryA
/product/description/item-in-categoryA
/product/description/item-in-categoryA2
...
0
votes
1answer
20 views
If statement comparing two string ee variables won't return false
I have the following code in a template:
segment is: {segment_3} <br />
category is: {category_url_title}<br />
{if {segment_3} == {category_url_title}}
submenu goes here
{/if}
It ...
0
votes
1answer
47 views
Using variables in if then
EDITED FOR MORE CLARITY
I have a really stupid problem I'm trying to fix... This is (a part of) template code
<dl class="tabs contained">
{if "{products_related_products:total_children}"}
...
2
votes
3answers
35 views
if conditions not working in JS
Why are my if conditions not working when they are inside a javascript but they work in plain html?
the {if longitude} outputs {if""} when viewed in the browser.
{exp:user:users sort="asc" ...
0
votes
3answers
117 views
Matrix Playa Count Conditionals issues
Sorry, I'm having a little brain freeze here and am hoping for some help.
I currently have the following code:
<div class="my-div">
{exp:playa:children channel="somechannel"}
...
1
vote
1answer
21 views
Conditional tracking
I want to exclude my site's tracking code(s) from my local development templates, but I've a hard time writing the conditional.
I am using an embedded template which contains the doctype, metadata ...
0
votes
0answers
19 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
2answers
36 views
Conditional variable error
I previously asked a question about this, but the question itself has kind of changed, and I don't know if anyone's still following it to begin with.
This is the error I'm seeing:
[06-May-2013 ...
0
votes
1answer
23 views
Exclude content from loop
I feel like I have seen a solution to my issue in the EE docs before, but now I can't find what I'm looking for. I would like to exclude some information from repeating inside of a channel entries ...
0
votes
1answer
45 views
Invalid EE conditional variable error - UPDATED
NEW INFO
OK, I found that the error was being thrown by a custom exception built into expression engine that will do partial matches on variable names if it doesn't find the original one.
From ...
0
votes
3answers
65 views
Conditionals in matrix field
I have a matrix field called {gallery} it has a column with 2 checkboxes - public and private
I would like to show only the items marked private but would also like an optional message if there are ...
0
votes
3answers
51 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
38 views
Output Code Once if Conditional is True for One or More Entries in a Group
I'm displaying a list of categories, and I want to add a little "new" icon next to the category name if one or more entries in that category have been created in the last day. But I can't figure out ...
0
votes
1answer
38 views
CartThrob: display content if certain product is in package
I'm using CartThrob for e-commerce. I need to display a block of content only if the package displayed contains a product with a certain entry_id. I was assuming I could just wrap the block of content ...
1
vote
1answer
20 views
nested conditional and if no_results
I'm trying to display a phrase based on the language_code
This is the code:
{exp:channel:entries
channel="offerte"
disable="categories|category_fields|member_data|pagination|trackbacks"
...
1
vote
1answer
27 views
Problem with playa inside url segment conditional
Having an issue placing playa inside a URL segment conditional. Inside the conditional, playa doesn't return entries, though if I substitute the playa call with simple text, the conditional works. And ...
0
votes
2answers
39 views
Need help with a conditional statement
I am trying to control what is displayed in a table view based on a conditional.
Here is the code I am trying to use:
<tr class="odd">
<td>Small</td>
...
1
vote
1answer
30 views
Display embedded templates inside a conditional statement if checked on publish page
In short: I need to display embedded templates based on whether they are selected by checkbox on the publish page, but my code doesn't work if more than 1 is checked.
I tried using the code below to ...
0
votes
2answers
86 views
'Fuzzy' conditionals
feeling little dumb for this.
What I am trying to do is to make my list of checkboxes checked depending on {segment_5}
If the value is '6', that is easy with
<input type="checkbox" ...
0
votes
1answer
41 views
Embedded variables conditional - Assets 2 Issue or parse order?
I am having an issue with an embedded template. I embed the template passing a "type" variable. Then, in the embed file it displays the content based on which "type" was specified. This all works, but ...
2
votes
3answers
60 views
Why are PHP and Stash variables not set as expected within EE conditionals?
I boiled my problem down to this template code on a template with "Allow PHP" set to "YES" and "PHP Parsing Stage" set to "Output":
{if 1 == 1}
First block
<?php echo '1 == 1 is true'; ?>
...
1
vote
1answer
39 views
Suggested method to watermark images on a case-by-case basis? (Matrix+CE Image or Channel Image)
I want to add watermarks to some images that I upload to an EE site.
I create images/illustrations and want to watermark those. It's helpful when the images come up in Google Image Search, both for ...
3
votes
1answer
43 views
{if:else if} & Matrix - Help!
I'm trying to add a conditional that checks if some Matrix fields are populated.
If there's content, it'll enter the content within the Matrix fields. If not it'll default to another value.
However, ...
0
votes
3answers
60 views
Nested conditional is not displaying content
I have a .sidebar template which is in a template shared by a few inner pages of the site. It pulls in the channel based on a preload tag on the page it is embedded in.
I have a conditional set to ...
1
vote
4answers
42 views
Display Currently Selected Category Inside Safecracker Form
How do I display the currently selected category for the channel entry inside a Safecracker form?
I tried:
{categories}
{if checked}
{category_name}
{/if}
{/categories}
I also tried ...
0
votes
1answer
38 views
Expresso Store Stock Conditionals
I know how to make the stock show as 'in stock' or 'out of stock' by using:
{if total_stock} In Stock {if:else} Out of Stock {/if}
How can I code the following:
"In stock" if we have more than 5 ...
2
votes
2answers
54 views
Conditional Formatting: if the value matches one of these
I'm using a multi-author field (VZ Members) that outputs this for author IDs;
4333|3871|3957
How can I show entries that match the logged in user? Something like:
If logged_in_member_id matches ...
0
votes
1answer
41 views
How to Display an Entry's Category?
I'm on a single product entry page. The URL does not specify the category. In fact, the entry has 3 category groups associated with it. I want to display the first category assigned from each of the ...
2
votes
1answer
39 views
How do I prevent expired linked events from being displayed?
I have the following code on a listings page that is meant to display linked events that occur in the future.
{reverse_related_entries weblog="events" sort_by="date" show_expired="no"}
{if ...
2
votes
1answer
23 views
parse order and nested conditionals
Can i nest simple conditionals and are nested simple conditionals still parsed early?
What happens when nesting an advanced conditional inside a simple conditional?
(wiki answer)
2
votes
1answer
52 views
How can i test in code if current page is the homepage
Is there a code condition that I can call to detect if the user is currently on my sites homepage.
In Wordpress (and I'm sure I will get panned for making this comparison) there is an 'is_homepage' ...
0
votes
3answers
48 views
Problem with pagination links and conditional [duplicate]
I have a single template I'm using to display a list of audio files. When the user clicks on the audio they want to listen to, it uses a conditional statement to display the single entry in the same ...
0
votes
0answers
42 views
Issue setting up freeMember Plugin
i am having an issue with getting the plugin FreeMember to work, i am not 100% sure whether i have added the correct variables, added the correct configuration setting, or there's a general conflict ...
1
vote
3answers
79 views
Conditional based on the age of an entry
I want to embed a template if the entry_date of an entry is less than a certain age, and display something else otherwise. Is there a good way to do this natively? With addons? I tried the timespan ...
2
votes
2answers
39 views
displaying expired entries
Is there a way where i can create a function that only displays expired entries? I have a page set up that displays, up and coming and pervious events click here when the user clicks on the pervious ...
3
votes
2answers
79 views
PHP Syntax Error from ExpressionEngine Template
Here's some code I'm using to generate Breadcrumbs on my site. Unfortunately the client has quite specific requirements in terms of URLs, so I've had to play around with Crumbly's tag a little using ...
2
votes
2answers
55 views
Conditional display of fields in CP entry screen, based on other fields' value/state
Is it possible to show / hide certain form fields on an entry page depending on whether or not, say a checkbox is selected? Hoping for an add-in that can handle this.
3
votes
1answer
42 views
Using pagination with filtered entries
I am filtering a list of entries using an {if…} conditional, but the exp:entries tag outputs the count for the total number of entries before the conditional is applied. And as I am using pagination I ...
3
votes
1answer
27 views
How to correctly use {if allow_comments}?
I'm having trouble grasping the usefulness of {if allow_comments}. The comment:entries loop and comments form code are both supposed to be outside of channel:entries, but presumable {if ...
0
votes
1answer
32 views
If author/screen_name
I have a list of channel entries written by different authors.
How can I create a conditional to display a link if it is a certain author?
For example I want to display a link to a specific author's ...
2
votes
1answer
52 views
plugin value in a template conditional
I've frequently done this with success:
{if '{exp:my_plugin:my_method}'}My method returned true{/if}
Or the opposite also works:
{if '{exp:my_plugin:my_method}' == '0'}My method returned ...
1
vote
1answer
44 views
If statement with OR always returning TRUE
I'm doing lots of checks against segments to try and perm redirect a very large list of old URLs and seem to have run into an issue with conditionals.
{if segment_1 == 'category' OR segment_1 == ...
0
votes
1answer
50 views
Playa with conditionals and snippets
I seem to have a problem with Playa + conditionals + snippets. I've emailed P&T since it may be an error in Playa.
I'm trying to accomplish a listings page where the information displayed depends ...
0
votes
2answers
49 views
Advanced conditional to show entries where a field is empty
I'm trying to show a list of all entries in a certain channel, in a certain category. I've got that much. In that, I'm trying to list all entries where a certain field is empty. I'm not getting the ...
3
votes
1answer
26 views
Accessing Master Config environment names within templates
I'm using Focus Lab's brilliant Master Config https://github.com/focuslabllc/ee-master-config but wondered if it is possible to use the ENV constant in a template?
Something like this?
{if ENV == ...
2
votes
2answers
93 views
{count} is counting entries I don't want it to
Basic functionality I'm looking for has to do with counting the results from a reverse_related_entries pair while excluding certain categories. I'm hitting a wall. We have multiple locations and each ...
3
votes
1answer
63 views
How to display ONLY entries that have at a particular field present (like image)
How can I display entries that only have a particular field completed.
In my case I am displaying all entries but would like to exclude any entries that have no image field completed. The image ...
2
votes
1answer
58 views
How do I redirect users to group-specific pages on login?
I have a log-in page that needs to direct users to content based on their member group. Currently it is very simple with just two pages.
I have tried it using the single option and it directs ...
5
votes
1answer
77 views
Has conditional logic changed in ExpressionEngine 2.5.5?
Although I can no longer find the reference on the ExpressionEngine forums, I was advised several years ago by Ellislab staff to use:
{if my_custom_field != ""}{/if}
rather than:
{if ...





