-
-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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-conditions I 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! :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat! 🥃
Fixes #1483
Fixes #1470
One outstanding issue:
The default slugOrId is set here.
Trying to get the
|link
on the/terms-and-conditions
page breaks the url, because the ContentExtension::getLink always overrides the slugOrId param, hence the link becomes:/terms-and-conditions?slugOrId=someUnexpectedSlug
where someUnexpectedSlug is the slug from the content.
I'm not sure how to fix this elegantly? @bobdenotter