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
Accepted
Matching more than one segment
I would use this to check multiple pages:
{if "page1|page2" *= segment_2} active {/if}
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 == '...
2
votes
Accepted
Compare url segment and category name with conditional
Found a solution using Low Seg2Cat plugin to get category_id from segment url:
{if segment_4_category_id == category_id}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
template_group and template_name not matching segment_1 and segment_2
There was a recent bug for template permissions. Newly created templates couldn't be viewed by anyone, and while this has been fixed in recent versions it's still true for duplicated templates. Go ...
1
vote
loading country code selection javascript file once per site visit
Use this Session add-on.
Add to your head (on every page):
{if "{exp:session_variables:get name="js_deployed"}" != "yes"}
<script src="{cdn_url}{exp:setversion path='/js/geo.js'}"></...
1
vote
SyntaxError on identitcal pages
... My friend, did you check your resources? You are getting an error on the second page because you are accessing your Main.js from relative paths in your template.
jatecson.com/information : http://...
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"...
1
vote
require_entry problems with more than 2 segment
https://ellislab.com/expressionengine/user-guide/urls/template_routes.html
Template routes! These things are your friend. On your template, you want to set a template route that looks like this:
/...
1
vote
404 redirect not working, sending to another segment
The problem you're facing is related to the fact that the Channel Module doesn't look for entries on all segments by default.
Imagine 9 segments. The module would have to test every single segment ...
1
vote
Accepted
Using Category URL Title in Segment 1
I was able to solve this easily using Resource Router. In my master config file I added the following and it works like a charm:
$env_config['resource_router'] = array(
':category_url_title' =>...
1
vote
Using Category URL Title in Segment 1
Yes. I've touched on it in this answer using segment_2, but the same is true for segment_1 - you just have to rely on the default template group and the index template. There may be a lot of pages ...
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