Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Custom routes issue with breadcrumbs url path
bluesea
New
I have changed the "categories" to "forum" from Dasboard/Settings/Routes. I can visit the page example.com/forum/xx but the breadcrumbs url path remain the same as example.com/categories/xx. Is it a bug or something I need to change? Thanks.
Route Expression: forum/(.*)
Target: categories/$1
Type: Internal
Tagged:
0
Answers
Can anyone help?
Hello! I must have missed this post the first time around, sorry.
The URL is used by the dispatcher to determine what code needs to be executed. Routes are (generally) used to change the user facing URL into something more convenient or readable. This dispatcher checks for route matches, converts it internally, then goes about its business using the "original" route. In this case, the dispatcher finds
/forum/My-Category
and translates that into/categories/My-Category
and loads up the categories controller and passes in 'My-Category' as the first argument to theIndex()
method.Setting up a route essentially adds a URL (or a bunch) that still point to the original URL. Route definitions don't change how links are generated. You would have to modify each view, module, or controller that generate links and change them to suit your needs.
So... not impossible, but it will take a lot of work.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
If it is "just" a breadcrumbs display question, then you could take a look at
/library/core/class.theme.php
:Maybe changing the file like that:
and afterwards use that event to do a search and replace on the $Data would be possible.
Doing a search and replace in $Data without a hook directly there should at least be possible.
Changing core files is ugly and should be avoided, because you will lose that changes on every update.
Thanks RJ but I cannot make it to work.
The key is in this line:
He suggests you modify the core to fire an event which you can hook into via a plugin.
You still have to come up with the logic/plugin.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.