4
votes
Accepted
Why is the OR not working in a conditional statement?
Well here is the issue. You are trying to give OR condition for 2 strings. OR condition will return true if any one of the given statements are true.
If you want to execute the code when url_title ...
3
votes
Why is the OR not working in a conditional statement?
You should try your code in below manner.
{if ! 'portfolio|photos' *= segment_2}
<h1>Conditional content.</h1>
{/if}
You can also try in another way also.
{if segment_2 == '...
3
votes
Accepted
Matching more than one segment
I would use this to check multiple pages:
{if "page1|page2" *= segment_2} active {/if}
2
votes
Accepted
Simplify segment conditional documentation
The conditional operators that work in EE are listed in the documentation.
The two conditional forms you talk about are not equivalent, they just happen to give the same outputs for the inputs you ...
1
vote
Matching more than one segment
You can try below code.
{if segment_2 == "page1" || segment_2 == "page2"} nav-expanded nav-active {/if}
I hope this will works for you.
1
vote
Accepted
"URL Segment Support" configs on Apache mod-PHP 7.2 server
The web server just needs to pass environmental variables on to PHP. For segment support, this means that PHP needs the ability to access the portion of the URI after the script name, e.g. the foo/bar ...
1
vote
convert segments from archive url to date variable and use in template
If you want to keep php out of your template, but still be able to use php string manipulation you could use CE String to do so.
http://docs.causingeffect.com/expressionengine/ce-string/index.html
...
1
vote
require_entry problems with more than 2 segment
Based on my understanding of the issue...
Try this:
{exp:channel:entries channel="recipes" url_title="{if segment_2 != 'dessert'}{segment_2}{if:else}{segment_3}{/if}" limit="1" require_entry="yes"...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
segments × 79url × 22
categories × 15
conditionals × 13
channel-entries × 8
url-title × 7
structure × 5
404 × 5
entries × 4
redirects × 4
advanced-conditionals × 4
templates × 3
css × 3
navigation × 3
switchee × 3
low-seg2cat × 3
freebie × 3
ee2 × 2
htaccess × 2
transcribe × 2
ifelse × 2
pages × 2
path × 2
stash × 1
safecracker × 1