Questions tagged [segments]
The segments tag has no usage guidance.
79
questions
0
votes
1
answer
56
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 != ...
0
votes
2
answers
210
views
Multi-Language lang switch Transcribe
I have a issue with my language switcher when i'm in a entry page.
In this page, i rewrite the last-segment url witch is my product name with this script :
<?php
$outvar = "";
$...
2
votes
3
answers
114
views
Why is the OR not working in a conditional statement?
Running EE 3.5.15
I am trying to show content based on URL segment and the following is not working correctly:
{if "{segment_2}" != "portfolio" || "{segment_2}" != "photos"}
<p>Conditional ...
1
vote
3
answers
51
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 == ...
0
votes
1
answer
315
views
"URL Segment Support" configs on Apache mod-PHP 7.2 server
I'm moving a site from Nexcess to Google Cloud hosting, and it appears the server doesn't support URL segments by default.
What do I need to have my web hosting do in order to enable this? They said ...
0
votes
2
answers
336
views
Adding Category in URL link
How do I include the category name in the URL and have that link work? I have a blog channel with a category called 'news'. I need the url to be - www.mysite/news/blog-post-heading. I currently am ...
0
votes
1
answer
234
views
Segment Variables & Case Sensitivity
I'm having an issue with case sensitivity in URL's. I have a template that includes a channel entries tag that loads a structure entry, a structure nav that starts from segment_1, and a {...
0
votes
1
answer
552
views
loading country code selection javascript file once per site visit
On my website I am displaying a country specific icon for the visitor. I'm doing this by setting a data-country variable in the head of the html document and loading a javascript file that sets the ...
0
votes
2
answers
256
views
require_entry problems with more than 2 segment
www.cooking/recipes/apple_pie
The first Expression Engine segment (recipes) represent the recipes channel, and the second segment represent an entry (here apple_pie)
If an entry doesn't exist or is ...
1
vote
1
answer
696
views
SyntaxError on identitcal pages
I have two pages serving up the exact same static page. I get an error on the second page, but I can’t figure out why.
No error: jatecson.com/information
Error: jatecson.com/set/images
I get this ...
1
vote
1
answer
53
views
convert segments from archive url to date variable and use in template
Trying to grab the month and year from URL on an archive page (i.e /blog/2017/02) and convert to a date variable and display as such in template "February, 2017." Using EE3.
Open to add-on or out of ...
0
votes
1
answer
126
views
Managing multiple segments in template routes
For one of my templates, I need two extra segments.
If I have the following in template routes, the page only loads if there is 1 segment.
/gallery/{alpha_dash}
If I add the following, it fails:
/...
0
votes
2
answers
82
views
IF conditional using segment_url leave a blank space in text
In creating page titles based on URL segments (for list pages), we have utilized conditionals that point to the segment urls for conditional inclusion. HOWEVER when the page source is viewed (and the ...
0
votes
1
answer
195
views
EE and Structure nested entries
I'm using Expression Engine 2.7.2 and Structure 3.3.17 and am having a problem creating a nested URL structure.
I have one Channel "Landing Pages" whose entries point to the template /region/index ...
0
votes
3
answers
76
views
Can channels be loaded dynamically based on url segments
Im constructing a website with four 'microsites' that have roughly identical page structures. Another relevant point here is that while the content and page structures will be effectively identical, ...
0
votes
2
answers
61
views
404 Redirect when there are too many segments
Having some issues forcing a 404 redirect when there are too many segments. Here is the page I am working on http://syntropy.highimpact.com/case-studies/aurora-flight-sciences/
I'm using the ...
0
votes
1
answer
174
views
Activate Active Class on Menu When On Current Page
The code below shows all the pages in that channel active. I just want to show the page the users is on. As it is set up now all the items in the menu are .active. What am I doing wrong.
<div ...
0
votes
1
answer
38
views
template_group and template_name not matching segment_1 and segment_2
Using EE 3.0.5
http://example.com/documentation/style_guide
template_group: documentation
template_name: index
segment_1: documentation
segment_2: style_guide
The style_guide template is not ...
0
votes
1
answer
89
views
Compare url segment and category name with conditional
I'm trying to write a conditional so that the I can output an active css class when the url segment is the same as the category name. Because the url segment includes dashes between each word and ...
0
votes
2
answers
88
views
404 redirect not working, sending to another segment
I'm having problems with a template sending a missing page to another segment rather than the 404 page. For example, The URL below would give us our Disney Ship.
WEBSITE/cruises/disney/ships/...
0
votes
2
answers
204
views
Using Category URL Title in Segment 1
Is it possible to use category_url_title in the first segment without having to create a template group for each category? I'd just like to link to categories on the fly using the first segment (site....
0
votes
2
answers
89
views
EE reading path variables as subfolders/subpages and giving 404 error. What am I missing?
I've got a page: /events/ that I'd like to pass year and month into: /events/2014/07/ ...and access them ({segment_1}, etc) in the template being used for that page.
But when I go to the url http://...
1
vote
1
answer
4k
views
Remove question mark in URL with "Force URL query strings" enabled
in one of my sites I had to enable "Force URL query strings" because my hosting provider doesn't have "URL Segment Support" enabled.
I don't have the permissions to change Apache configuration file ...
2
votes
2
answers
695
views
Can I do math on segment variables?
I want to build a very simple linear survey with multiple choice questions.
Each answer will be assigned a numeric value and I was hoping to pass that value via segment variables.
So at the end of ...
1
vote
1
answer
53
views
Setting a category from segment in .xls download template
We've set up a template to download an .xsl file of entries in a number of specific categories (with much help in this SE thread) - all works fine if we hardcode the category ID but if we tray to make ...
0
votes
3
answers
249
views
Can you use segment variables with the Pages Module?
I have a very specific URL structure I'm trying to set up:
city-segment/venue-segment
ex. houston/the-bar
"city-segment" pulls from a City Channel while "venue-segment" pulls from a Venue Channel. ...
0
votes
1
answer
59
views
Unable to select entry by last segment
I have the following code:
{if segment_1 == 'special-offers'}
{exp:channel:entries channel="products" dynamic="no" url_title="{last_segment}"}
<link rel="canonical" href="{...
0
votes
1
answer
328
views
Displaying Entries by Category name not working
I'm using Low Seg2Cat and I'm trying to display a list of entries by their Category Name.
if I use the category id I can pull the entries, however using the Category name is a no go.
{exp:channel:...
1
vote
1
answer
51
views
Using url segments to display content
I am building a newsletter template that will display between 5 and 7 articles. My client will get to choose which articles will display by putting the entry_id's in the url (ex. http://site.com/...
0
votes
2
answers
64
views
No segment variables - Zoo Triggers and MSM
We running a site which uses MSM and Structure. To get around the 'category' issue in Structure, we've added Zoo triggers, which works great on the default_site but not so well in the MSM sites.
In ...
0
votes
1
answer
99
views
Dynamically setting case value with switchee
I'm wanting to dynamically populate a switchee value, I've tried using an embed, but it seems the parse order means this won't work so I'm looking for aternative ideas, this is the code we've tried:
{...
0
votes
1
answer
55
views
URL Segments Keep Building Up (Using Navee)
URL segments keep building up with each link I click -- Never had this issue occur before.
Navee include:
{exp:navee:nav nav_title="main"}
The first time I click the link, it works fine:
When ...
0
votes
1
answer
132
views
Third segment / last_segment "success" not working?
I am attempting to display a message when the last segment equals "success"... I've done this many times before and for some reason I am having some trouble. I need an extra eye perhaps?
Below is my ...
0
votes
1
answer
140
views
Pass segments to variables in exp channel entry
I have the following structure:
A link - a href="/year/1991"> 1991 /a
And inside the YEAR template is this: {exp:channel:entries channel="channel" limit="10" search:year_event_field="=1991"}
{...
0
votes
1
answer
83
views
Circumventing the maximum number of segments limit
It says in a support thread that Expression Engine has a maximum number of segments allowed that can't be changed (I can't think of a reason why they would need to do so).
I can't change the ...
2
votes
2
answers
154
views
Best practices: Location-aware Navigation in EE2?
Recently upgraded an older Expression Engine site from 1.x.x to 2.7.3, and looking to upgrade to 2.9.0 and optimize some of the slower code. One of the issues I'm working on is getting rid of a lot ...
0
votes
2
answers
168
views
I need more than 10 segments
Does anyone know of a predefined way to increase the number of URI segments ExpressionEngine allows before it throws an error. This is currently set to 10 and I'm sure I could hack the core to achieve ...
0
votes
1
answer
51
views
Security on a redirect page for a short URL service
I'm setting up a simple short url service which utilises a template (code below) to forward the user to the correct page based on an entry id in the URL.
The following code is based on EllisLab's ...
2
votes
3
answers
672
views
Using Dynamic URL's in {Segment_1}
Is it possible to use dynamic urls in {segment_1}. I prefer not to use a plugin and might opt for a mod_rewrite solution but I am curious if this is possible out of the box.
For example... http://...
1
vote
1
answer
122
views
Inconsistent URL paths
Having some issues with paths on my build, i get a different output using {site_url} to {path='site_index'}, {site_url} outputs the correct value but {path='site_index'} outputs the correct value with ...
0
votes
1
answer
115
views
Conditionally targeting the 404 template
When I get a 404 page, the URL in the browser remains pointing to the page I was trying to reach. ie. the address bar will show domain.com/unreachable-page not domain.com/404. Which is fine and, I ...
1
vote
2
answers
2k
views
Display content if url segment does not match a url_title
I am using pages to display content on a page called Speed Sales. I display the entry by checking for segment_2 and matching it to a channel entry basically. I need to display content in case someone ...
1
vote
1
answer
59
views
Entries list without know ID of Category - want to usw category_url_title
In my URL I have the category (segment_2).
And now I want a list with all entries from this category.
If I use category="8" its fine, but in my URL isn't a ID... it's the {category_url_title}.
{...
1
vote
1
answer
1k
views
if last segment equals url title
I am trying to show an active class if an entry is being viewed but my conditional's are not working:
{if last_segment == '{url_title'} class="active" {/if}
I am using an embed of a list of ...
2
votes
1
answer
151
views
If statement on segment eq url_title - strange behavior
My goal was to mark current/active article on the list. Code looks like:
<ul class="list-plain">
{exp:channel:entries channel="products" category="{segment_3_category_id}" orderby="title" sort="...
2
votes
1
answer
58
views
Long URL's and templates
I'd like to use some templates to display content at segment 4 of the URL.
http://example.com/news/world/australia/melbourne
News and World have their own templates and Australia is channel entry ...
2
votes
2
answers
621
views
Search in Grid field - Relationship
I have a question concerning the function of research in Grid field, specifically on a relationship field. Here's my problem:
I have a grid field for a product catalogue, with many fields for each ...
2
votes
1
answer
123
views
Google indexing weird EE URL's
One of our clients is having a problem with Google indexing incorrect URL's.
The shop templates are using something like...
{if segment_2 != "" AND segment_3 == "" AND segment_4 == ""}
Parent ...
0
votes
1
answer
66
views
Using Low Events with Seg2Cat?
Trying to build a simple event filtering system with categories (Seg2Cat) and dates. This is my current approach (which does not work):
{exp:low_events:entries channel="events_submitted|...
0
votes
1
answer
46
views
Plugin to format url_segment as a decimal
Need to take the final url segment which is in the form of group/index/1030 and format it to be 10.30 to signify a time.
Anyone know of a plugin? The only ones I've found format it as a price and ...