Add ability to override routing with record_route#1484
Conversation
|
I see the problem! First, it works for the generated canonical just fine, it seems: But, it doesn't work correctly when using This is because it's configured with some defaults, and then you generate a route for something that has different values for these specific things. This is undesirable, but it's also the correct behaviour, I think. If i'd set those values as defaults (and make sure there's an termsandconditions:
path: /terms-and-conditions
defaults:
_controller: Bolt\Controller\Frontend\DetailController::record
contentTypeSlug: 'entry'
slugOrId: terms-and-conditionsI think this is not something we can fix, but it does have a workaround.. What's more annoying is the following: That'll make any |
|
I see now! I am not sure I could replicate the I was able to get it working if I change And then the |
Still, that's better than it was before. If you fix the tests (seems pretty straightforward in this case), let's merge and move to the next item on the list for now! :-) |



Fixes #1483
Fixes #1470
One outstanding issue:
The default slugOrId is set here.
Trying to get the
|linkon the/terms-and-conditionspage breaks the url, because the ContentExtension::getLink always overrides the slugOrId param, hence the link becomes:/terms-and-conditions?slugOrId=someUnexpectedSlugwhere someUnexpectedSlug is the slug from the content.
I'm not sure how to fix this elegantly? @bobdenotter