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

Custom URLs break pathing??

How Do I?

Skythe's avatar
Skythe
5 posts
4 years ago
Skythe's avatar Skythe

You got a template at about/index.
If should be accessible via about/my-fancy-url.
You fill out the Template route override field at Template > Access.
The page is now accessible via about/my-fancy-url.

But neither {route="about/index"} nor {route="about"} or {path="about/index"} or {path="about"} return the correct URL!
Am I holding it wrong?

P.S. I tried with a non-index page and got the same results btw.
P.P.S. The Preview button on this forum does nothing?

       
Skythe's avatar
Skythe
5 posts
4 years ago
Skythe's avatar Skythe

Anyone who’s not a spam bot?

       
Zignature's avatar
Zignature
5 posts
4 years ago
Zignature's avatar Zignature

Did you try creating a template route at Developer > Templates > Template Routes?

https://docs.expressionengine.com/latest/control-panel/template-manager.html#template-routes

       
Skythe's avatar
Skythe
5 posts
4 years ago
Skythe's avatar Skythe

Hey Zignature,

as far as I can tell, Developer > Templates > Template Routes does the same as Template > Access > Template route override. A route you create via one tool will appear in the other.

But the problem remains: I’m not able to link to that template via any {path=xxx} or {route=xxx}.

Looking at the (bad) documentation, I cant help but ask what that’s supposed to be. The example is /segment/{variable}/{variable:rule}/{variable:rule0|rule1[arg]}. What? How about you explain the basics first? How do I link to a template using a custom route? Why does the documentation explain the most complicated route (and only that), but not how to link to it? That makes no sense.

Maybe its just not possible (anymore).

       
Zignature's avatar
Zignature
5 posts
4 years ago
Zignature's avatar Zignature

I successfully created a couple of routes after reading this tutorial: Template Routes for Single Entry / Permalink URLs.

By the way, the routes I created through Developer > Templates > Template Routes do not appear at Template > Access > Template route override

       
Skythe's avatar
Skythe
5 posts
4 years ago
Skythe's avatar Skythe

@Zignature Are you running the current EE 6.0.3? My EE does not do what you describe.

I’ll go through the tutorial you posted and report back.

       
Skythe's avatar
Skythe
5 posts
4 years ago
Skythe's avatar Skythe

Alright, I think I got it now. This won’t work with EE, but it’s not a bug either.

I wanted to create long and fancy URLs for pages without having to use those long and fancy URLs in path variables or as names of the template groups.

I wanted the template group to be test, link to it via {path="test"} or {route="test"} and have EE turn the link into whatever I declare in the CMS, like /very-nice-page-with-lots-of-content.

That’s not how custom routes work in EE. They’re not aliases. They’re invisible template groups that include existing template groups when called.

Thanks @Zignature for your time and effort! <3

       
Zignature's avatar
Zignature
5 posts
4 years ago
Zignature's avatar Zignature

You can use the URL Title field for that, unless you want it set dynamically.

And maybe Variable Modifiers would work for your use case: https://docs.expressionengine.com/latest/templates/variable-modifiers.html#url_slug

P.S. I’m running EE 6.0.3 😊

       
Zignature's avatar
Zignature
5 posts
4 years ago
Zignature's avatar Zignature

Actually, variable Modifiers are for output, not for input I guess.

       

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.