-
-
Notifications
You must be signed in to change notification settings - Fork 208
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
host_with_path with dynamic page. #1474
Comments
When I try debug method matchRequest in Sonata\PageBundle\Site\BaseSiteSelector
|
Hey @mesiarm I use multi site in my project too, but for dynamically routes, I create an action in a controller (a normal symfony's action) to manager this route! But there isn't too much doc about this, I guess you need to check in the code how it works, But if it works for you provide some Pull request improving the documentation about this please, maybe it can help others. |
have you tried to use |
I created App Project Detail page with /project/{slug} page and then created ProjectController with detail action and route setting:
|
Just to mention that I have done something like this: #1368 |
Hi @haivala thanks for share your issue here :) But definitely we need more documentation about this, should be really good if someone that used this can provide some doc, unfortunately I didn't test this functionality yet. But @mesiarm if you want to test this solution and add some doc, it will be really good :) |
#752 - simmilar issue. Dynamic page should be definitely better documented, how to use it, maybe someone, who used this functionality in his/her projects could provide more information. I will try to look at source code to understand it better. |
"@^(/)(/.*|$)@" regex in matchRequest in Sonata\PageBundle\Site\BaseSiteSelector causes / as default site relative path is not supported. |
So if default site relative path cannot be / - is it bug or is it intended? |
Can't it be "/" or "/-"? If you mean it can't be "/-" then I would say it's intend, Because this slug/url is more or less wrong?🤔 Or is it missing the locale like "/de-en"? |
I mean only / (without dash). I wanted to use / for default site and /en for English site. |
Well if you can't use with / and /en ,I would say it's a bug 🤔, what do you think? I use this functionality but with multisite |
Just to clarify: /en works, /anything works, but / doesn´t. Regex is sprintf('@^(%s)(/.*|$)@', $site->getRelativePath()) |
I guess you can create a site with relativePath = null |
I think it wouldn´t match mentioned regex which is in method matchRequest in Sonata\PageBundle\Site\BaseSiteSelector |
correction - I tried it with null and it works (probably due |
But the question is, is it the correct way 👀 , I don't know why the doc says that the default value is |
Yes, any falsy value in relativePath works, / doesn´t work. |
well in this case we should provide a fix for this! like doesn't accept "/" in relativePath we could use |
Yeah I checked now and in the project that I'm working it's |
Does #1606 fix this issue? |
I want create sites for diferent locales (example.com/page, example.com/en/page) so I am using host_with_path multisite option. But dynamic page (example.com/project/{slug}) stopped working and when visiting example.com/project/example it redirects back to example.com. When I added dynamic page to ignore_uri_patterns, it works, but blocks in global page doesn´t work.
The text was updated successfully, but these errors were encountered: