Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.
4 votes
Accepted

Dynamically setting case value with switchee

While you could easily use Stash to pass the entry ids as a variable, you shouldn't. To create the variable would mean iterating over the entire list of entries in a channel. That's expensive just ...
user avatar
  • 5,234
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 ...
user avatar
3 votes
Accepted

Unable to select entry by last segment

Check the date on the entry. Perhaps it has accidentally been set to the future at some point and so only just started working now. Just a thought.
user avatar
3 votes
Accepted

Can I do math on segment variables?

Theoretically it is possible. IF you are on EE 2.9+ you can use Mathematical Operators in your conditionals. (Thanks Derek for reminding me about that!) If you are using a version below EE2.9 you ...
user avatar
  • 7,556
3 votes

Using Dynamic URL's in {Segment_1}

ExpressionEngine 2.8's introduced Template Routes so you now have more control over how your templates are processed. It allows you to override the default template route, which is /template_group/...
user avatar
  • 1,449
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 == '...
user avatar
3 votes
Accepted

Matching more than one segment

I would use this to check multiple pages: {if "page1|page2" *= segment_2} active {/if}
user avatar
2 votes

Using Dynamic URL's in {Segment_1}

As long as you don't have a template or template group named that url title, you can code your index template to take in {segment_1} as a url_title. {exp:channel:entries channel="foo" {if segment_1}...
user avatar
2 votes
Accepted

Inconsistent URL paths

Turns out this was due to Transcribe, we needed to use {exp:transcribe:uri path="/"} paths!
user avatar
  • 693
2 votes
Accepted

URL Segments Keep Building Up (Using Navee)

You need to start your URLs with a forward slash so: work/category/web/ becomes /work/category/web/
user avatar
  • 2,654
2 votes
Accepted

I need more than 10 segments

As far as I know this flatly can't be done without hacking the core and even then it's possible that third-party functionality (and even base functionality) might break. Maybe explain your issue a ...
user avatar
  • 1,403
2 votes
Accepted

Security on a redirect page for a short URL service

The only thing i see from a security standpoint is EllisLab considers php in template a bad practice. If this where me I would create a small plugin that would render your PHP for you. and pass the ...
user avatar
  • 1,029
2 votes
Accepted

Setting a category from segment in .xls download template

It should work fine. You're just missing a dynamic="no" on your channel:entries tag. Try it like this: {exp:channel:entries channel="my channel" category="{segment_3}" disable="...
user avatar
  • 7,941
2 votes
Accepted

Can you use segment variables with the Pages Module?

You can do this using Resource Router instead of the Pages module. In your system/expressionengine/config/config.php file: $config['resource_router'] = array( ':any/:any/(info|menu|hours|...
user avatar
  • 4,002
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}
user avatar
  • 273
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 ...
user avatar
  • 3,562
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'}"></...
user avatar
  • 5,353
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://...
user avatar
  • 5,900
1 vote

Using url segments to display content

I never used EECMS 1, but I gonna try to help you. There are some errors on your code. The segment_1 is always newsletter. You never could use it on {exp:weblog:entries entry_id="{segment_1}&...
user avatar
  • 6,108
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"...
user avatar
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: /...
user avatar
  • 5,900
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 ...
user avatar
  • 6,108
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' =>...
user avatar
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 ...
user avatar
  • 5,353
1 vote

Can I do math on segment variables?

Yes. The rest of this answer is to meet the minimum 30 character requirement. ;)
user avatar
  • 2,255
1 vote

Can you use segment variables with the Pages Module?

It seems like an embed might help you get the job done. Can you you do something like this: {embed="_embeds/venue" segment_2="{segment_2}"} Then in your embedded template: {exp:channel:entries ...
user avatar
1 vote

Displaying Entries by Category name not working

If you're using lows Seg2cat you can use {segment_3_category_id} EE can only use an id parameter in the channel entries tag. {exp:channel:entries channel="channel_name" dynamic="off" category="{...
user avatar
  • 3,163
1 vote
Accepted

Pass segments to variables in exp channel entry

Because if you have a four digits segment, EECMS will try to filter the entries by the year of their creation. Try to set the dynamic parameter to no.
user avatar
  • 6,108
1 vote

Circumventing the maximum number of segments limit

If you have structured you htaccess like the htaccess example. ExpressionEngine will not be consulted when accessing folders or files on your server. These two lines in the htaccess are important ...
user avatar
1 vote

EE reading path variables as subfolders/subpages and giving 404 error. What am I missing?

Probably you're getting a 404 because the exp:channel:entries tag is trying get all entries of the year 2014 and month 07. If you need to use years, months and days as segments, you gonna need to set ...
user avatar
  • 6,108

Only top scored, non community-wiki answers of a minimum length are eligible