Questions tagged [segments]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
5
votes
3answers
1k views

How do I display a category name based on a segment?

I'm trying to show the category_name of segment_3. If I use the variable {segment_3} it displays the short name, I want to show the Full name. Any suggestions? Thanks in advance.
4
votes
2answers
600 views

Anyone know how to capitalize a page title?

I'm using the {segment_2} variable to complete various bits of info on a page. The segment is all lowercase, but that's fine as I'm using CSS to capitalize those elements. The problem comes when I'd ...
4
votes
1answer
187 views

How to deal with Seg2Cat no results in channel query

I'm using Low Seg2Cat to retrieve the third segment of my url and pass it as category to filter a listing page. Problem is that when third segment is empty I have no-results, where I was expecting a ...
4
votes
3answers
998 views

Hide template_group segment in URL

I've seen this question in Google but the link ended up dead on the Ellislab page. I have a not too big site which resides all in one template group. Is it possible to remove the template group from ...
3
votes
4answers
2k views

Detect any pagination in a conditional

I've got a site where it shows different content dependent on the url segments (categories eugh!) but as there can be up to 4 url segments, any of which could have pagination, i want to be able to say ...
2
votes
2answers
296 views

Parsing URL with hashes

Have this URL: http://192.168.1.2/univsched#/csf How can I parse this using EE tags? I want the value: csf segment_x tags don't work.
2
votes
2answers
142 views

How Does ExpressionEngine Handle Outside Directories?

I have a directory in my web root (let's call it microsite) that is not managed by my main ExpressionEngine site, but people still need to access it. So, naturally, I just navigate to http://mysite....
2
votes
3answers
111 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 ...
2
votes
3answers
660 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://...
2
votes
1answer
130 views

Segments producing active class

I have a simple unordered list nav, it displays an active list item depending on segment_1. Within that unordered list I have another unordered list with a class of 'sub'. For some reason, all list ...
2
votes
2answers
640 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 ...
2
votes
1answer
141 views

Limit entry using status and categories

I have a "featured item" part on my site that is controlled with a new status i created called "featured". I have 8 parent categories, and would like to have 8 different featured items, 1 unique for ...
2
votes
1answer
118 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 ...
2
votes
2answers
151 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 ...
2
votes
2answers
605 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
2answers
122 views

segment begins with?

Is there a way, WITHOUT PHP, to test if a segment begins with a value? We send emails with shortened URLs and want to be able to parse the segments accordingly. i.e. http://www.oursite.com/...
2
votes
1answer
479 views

query string params

Got a site that want to use tracking in URLS like http://domain.com/segment_1/segment_2/?utm_campaign=google Now this works fine locally but on the production server, it renders the 404. On MAMP I'...
2
votes
1answer
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
1answer
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
1answer
260 views

Remove segment and segment parts out of url

Alright I seem to hit rock bottom, and can't figure this out. I've googled and read several solutions here, and can't seem to implement them in my situation. This is probably an .htaccess solution, ...
2
votes
2answers
130 views

Site uses switchee to serve index or 'static' page; Now getting unexpected 404s

My site's index page template uses switchee to determine whether to serve up index (home) page or a "single page" entry from the static channel. I'm attempting to set up a 404 page for the site, and ...
2
votes
1answer
394 views

Gathering category_id value from segment - Low Seg2cat

Not sure if I doing it wrong, my basic url goes like this ==== 'site.dev/scooter' - I used {segment_1_category_id} and I get the value of "8" which is correct If my url is 'site.dev/8' and I used {...
2
votes
1answer
132 views

Error 404 with structure after the 2nd segment

I am using structure, and therefore, sometimes I have more than the standard 2 segements (template_group/template). the error page get's triggered whenever the first or the second segment is ...
1
vote
3answers
3k views

Remove segment from URL

I'd like to take any URL where segment_1 == "supernav" and remove that segment. So this: http://alpha.ced.berkeley.edu/supernav/gallery/ Would become this: http://alpha.ced.berkeley.edu/gallery/ ...
1
vote
3answers
47 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 == ...
1
vote
3answers
164 views

how to parse segment_3 in tag stash:embed:

This is my setup. My URL my-site/index.php/group/template-x Template-x must call two different pieces of code. I want that to happen by using the third segment, which shall be NL or BE. So my-site/...
1
vote
1answer
896 views

How to remove category URL indicator segment?

I have a products section with 5 different product categories and all products are assigned to one category only. The current URLs are like this -->http://site.com/products/category/oral-care/. I ...
1
vote
2answers
174 views

Can I use a conditional to match a string in a url segment?

The issue I’m coming up against is that a client’s site has a series of nested units, tasks and segments, and they want different conditionals run depending on the various segments. Now, I could use ...
1
vote
1answer
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 ...
1
vote
1answer
117 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 ...
1
vote
1answer
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 ...
1
vote
1answer
28 views

Access segments in hooks

Is it possible to access segment or page information in the hooks? Each hook has different parameters so I can't rely on those to get segment information.
1
vote
2answers
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
1answer
96 views

{url_title} In URL, and Edit Form on Next Page

having a bit of trouble getting the url_title from the filled out safecracker form to appear correctly, here is what i have: {exp:safecracker channel="personal_trainer_directory" entry_id="" ...
1
vote
1answer
52 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 ...
1
vote
1answer
694 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
1answer
50 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/...
1
vote
1answer
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 ...
1
vote
1answer
52 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
2answers
114 views

How does Freebie ignore segment_1 and know what template to use?

I am wanting to use Freebie to ignore segment_1. I want to use a 'programs' template group but dont want programs in the url. for example: NO - domain.com/programs/cycling YES - domain.com/cycling ...
0
votes
1answer
97 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
1answer
281 views

Removing root-level segment with Structure and Freebie

I am using Structure and Freebie on a recent project. I have a root-level page in Structure called “Supernav” with five sub-pages (Students, Parents, Faculty, Alumni, Galleries). When visiting any one ...
0
votes
3answers
246 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
1answer
56 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
1answer
44 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 ...
0
votes
1answer
842 views

If statement comparing two string ee variables won't return false

I have the following code in a template: segment is: {segment_3} <br /> category is: {category_url_title}<br /> {if {segment_3} == {category_url_title}} submenu goes here {/if} It gives ...
0
votes
1answer
293 views

Need some help with GWCode Categories, url segments, and conditionals

I have a products section where I give each product group a main category. Initially I had it setup where each product had a main category and a sub category. GWCode generated a side nav from the ...
0
votes
2answers
266 views

'Fuzzy' conditionals

feeling little dumb for this. What I am trying to do is to make my list of checkboxes checked depending on {segment_5} If the value is '6', that is easy with <input type="checkbox" name="...
0
votes
1answer
34 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
1answer
85 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 ...