We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Using the category_url_title as the category link

How Do I?

benmiller's avatar
benmiller
3 posts
8 years ago
benmiller's avatar benmiller

Hey there, the subject might be a little vague, let me explain:

<a href="https://expressionengine.com/products">{category_name}</a>

Generates this URL:

http://test.dev/index.php/products/category/test-category

However, what I’d like to do is use the {category_url_title} as the second segment instead of category, so it would look like this:

http://test.dev/index.php/products/test-category

I’d also like to achieve this with single entries, as well:

http://test.dev/index.php/products/product_url_title

My structure is basically this:

| product.group
| - - index.html

| products.group
| - - index.html
| - - category.html

But I’d like to group all of the above in the products.group template group if possible, so that I could have a structure like this, for example:

| products.group
| - - index.html
| - - category.html
| - - product.html

Without having to use the /category/ or /product/ segments in the URL.

Does that make sense?

       
Jeremy S.'s avatar
Jeremy S.
353 posts
8 years ago
Jeremy S.'s avatar Jeremy S.

You can reduce your amount of templates using conditionals and combining more than one view into a single template: https://docs.expressionengine.com/latest/templates/conditionals.html

Template Routes may also provide you some of the functionality you want in the URLs: https://docs.expressionengine.com/latest/urls/template_routes.html

       
Neil Evans's avatar
Neil Evans
1,374 posts
8 years ago
Neil Evans's avatar Neil Evans

As above, or: http://gotolow.com/addons/low-seg2cat

It gives so much choice, and always a good one to have.

       
benmiller's avatar
benmiller
3 posts
8 years ago
benmiller's avatar benmiller

Thanks! Both answers proved helpful, I am now using Low Seg2Cat.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.