I'm having two contenttypes, but in both I don't want the contenttype slug in the URL. So both contenttypes should match /{slug}
, but take the content from a differtent contenttype.
So I though, I create two routes, if the first fails, it will try the second:
# match on any landingpage created as a contenttype landingpage
landingpagebinding:
path: /{slug}
defaults:
_controller: controller.frontend:record
contenttypeslug: landingpage
contenttype: landingpage
# match on any actionpage created as a contenttype actionpage
actionpagebinding:
path: /{slug}
defaults:
_controller: controller.frontend:record
contenttypeslug: actionpage
contenttype: actionpage
So I have:
- a landingpage "/this-is-my-landingspage"
- a actionpage "/this-is-my-actionpage"
The landingpage is working, the actionpage gives a 404 error
landingpage/this-is-my-actionpage not found.
Why do I get a 404 on the landingpagebinding
? I expected it would continue to the next route, actionpagebinding
and tries to match on that. If that is also not found, then I want a 404 error!
Note: I know that when both contenttypes have the same slug, the first one will match. But that is not an issue.