-
Notifications
You must be signed in to change notification settings - Fork 26
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
remove LocalCode from the CmsPage url #38
Comments
Hi @rzp-789, have you tried removing the prefix on route in your
|
Hi @delyriand , thanks for your answer. And yes it's the first think i did but it's not enough. |
What is your issue, what happens when you try to go the the URL of your page ? 404 ? 500 ? We managed to disable CMS pages' localized URLs on a project without specific issue. |
so i follow this doc to disable local ( https://docs.sylius.com/en/1.9/cookbook/shop/disabling-localised-urls.html ), and i remove prefix like @delyriand recommand me above. |
If you run
Be sure your route is loaded. |
yes i have the same result
|
we work on a channel with only fr_FR local, maybe come frome there ? because i need to fill the channel when i create my page on admin |
Is your page enabled and assigned to the channel? |
Check the https://github.com/monsieurbiz/SyliusCmsPagePlugin/blob/master/src/Routing/PageSlugConditionChecker.php
Maybe you have another class which decorates |
Be careful of die on your example because some partial URLs are rendered and they call the context. |
ok i want to do but i don't really understand why it's dangerous in this case because nothing is personnal, and finally i found it's this condition on vendor/monsieurbiz/sylius-cms-page-plugin/src/Routing/RequestContext.php => function checkPageSlug line 79. Who return false and doesn't render the page but i would prefere not change the condition ... |
i finish by decorate directly router.request_context by mine and change the condition who block me. Thanks for your help ;-). |
Hi @rzp-789, Could you provide the override you've made please? At least we could understand the issue. Thank you! |
I changed the condition who compared 2 object request of function checkPageSlug, by something more specific like the PathInfo maybe it's not the better way but it's functionnal for my project :
|
Just a question, did you change the yaml in https://docs.sylius.com/en/1.9/cookbook/shop/disabling-localised-urls.html With this line I had some issue with this router in my memory, so I removed it :
|
yes i changed it, so you tell me without this line i don't need to override the router.request_context ? |
damn, i loose some much time because of this. Always stay alert with sylius doc. Thanks for your tips |
We have an issue open on this topic Sylius/Sylius#12227 |
I would want to remove the localCode in Url for the page created with this bundle, do you know a way to do this properly ? I tried but everytime i can't refind my CmsPage if i removed the localCode on my Sylius Application. Thanks for your help.
The text was updated successfully, but these errors were encountered: