Questions tagged [conditionals]
For questions that use logic to display or hide parts of a page/template
315 questions
0
votes
1
answer
65
views
How to display only to the current entry author and a related fields author
I'm trying to figure out how to display a particular entry ONLY to the logged in author of the parent entry AND to any authors of related field included in the parent entry.
This gets me 1/2 way there:...
1
vote
3
answers
115
views
Embedded template variables and conditionals?
In an upstream template, I do this code :
{embed="templatecategory/template" varA="{var1}" varB="{var2}"}
These variables are populated by a custom addon.
And in the ...
0
votes
3
answers
182
views
Template variables conditions
Im on Expression engine 7 now.
Im trying check template variable for condition. like so:
{if site_logo_path != ""}
<img src="{site_logo_path}">
{if:else}
<h1>...
0
votes
1
answer
33
views
Possible to match conditional from multiple values?
I'm trying to display relationship field "members" from selected "events" if their "field" value matches a certain "query":
{ev_members status="open|other&...
0
votes
1
answer
42
views
Conditionals within channel form custom_fields loop?
Trying to setup a public submission page/form using channel:form in ExpressionEngine 6.3.4, and the relevant channel has some fields that the user shouldn't be able to fill in/edit themselves, as I'll ...
0
votes
1
answer
115
views
IF conditional not working with Relationship fields in Fluids
When using a Relationship field with a Fluid field type the current_field_name variable can be printed out for debugging just fine, but IF conditionals don't work when using current_field_name.
{exp:...
0
votes
1
answer
85
views
Simplify segment conditional documentation
Exist an interesting method to simplify a multiple conditional:
If you want to execute the code when url_title not equal to "portfolio" neither equal to "photos" use this condition:
{if segment_2 != ...
1
vote
1
answer
214
views
Relationship Field Conditional Not Working
EE 5.2.2
I have a homepage channel with a primary entry that handles a bunch of stuff on the homepage. One of the things it has is a relationship field called featured movie that can have just one of ...
0
votes
2
answers
75
views
Channel Videos - Display if video exists
Confused as to why this does not work (EE5).
I have a Channel Videos field named {p_vids}.
In my template, within the channel:entries I have the below, but it doesn't display the video/code. (...
0
votes
1
answer
50
views
Setting up Fields and Logic
I’ve got a filtered portfolio project where the user will be able to add images or videos which pop up (like an overlay) without directing to another page. The user can also opt to add text content ...
0
votes
1
answer
215
views
Issue with fluid fields and conditionals
I have migrated a channel to using a fluid field instead of the old setup of one body field and one extended text field. The fluid field includes a textarea and a grid field that of course can be used ...
0
votes
3
answers
82
views
Display different content if the base-domain contains ".uk" or ".co"
{exp:channel:entries
channel="homepage_banner"
orderby="{ban_strt_date}"
sort="asc"
status="open"
limit="5"
url-title="{site_url}"}
{if url-title *= ".uk"}
<div ...
2
votes
1
answer
88
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 '...
1
vote
3
answers
108
views
Matching more than one segment
Matching one URL segments always works fine but is possible to match more than one?
For example this works:
{if segment_2 == "page"}nav-expanded nav-active{/if}
But this does not:
{if segment_2 == "...
3
votes
1
answer
88
views
EE3 - When image description is blank, use title field
I'm running into a roadblock here. Basically my client wants to use the "description" field of a file as the alt text, unless it isn't filled out, then he wants it to fall back to the page title. I am ...