SonataPageBundle
SonataPageBundle copied to clipboard
Twig path function and forcing the locale with multisite
Feature Request
I'm using multisite host_with_path
and I have Symfony route that is updated as Dynamic page with update-core-routes
.
Meaning that I have 2 routes: /example/{slug}
and /en/example/{slug}
as the another site is prefixed with the /en
and has locale en.
Now I render the page template and would like to have a link to the another page with the same route but different locale & site.
Twig path
function does not work by giving it parameter locale
or _locale
as it always gives the Symfony route.
How can I link to the another site page? meaning how I can force the locale? Do we need new twig function for this?
I guess I have to use the technical alias section of the page..
Dynamic page does not have Technical Alias field
Feature Request
I'm using multisite
host_with_path
and I have Symfony route that is updated as Dynamic page withupdate-core-routes
. Meaning that I have 2 routes:/example/{slug}
and/en/example/{slug}
as the another site is prefixed with the/en
and has locale en. Now I render the page template and would like to have a link to the another page with the same route but different locale & site. Twigpath
function does not work by giving it parameterlocale
or_locale
as it always gives the Symfony route. How can I link to the another site page? meaning how I can force the locale? Do we need new twig function for this?
Also now you have to insert all page blocks twice. Better option would be if page fields and page blocks would be translantable and you would need only translate texts and dont need to insert images again. Something like in https://docs.sonata-project.org/projects/SonataTranslationBundle/en/2.x/index.html But it would be lot of work. Easier would be option to duplicate page with all blocks to another site (another locale) and you would only translate some fields.
I don't see why it is a problem to insert the page blocks twice. Sometimes it does not even make sense to make the same page in another language as the content is so much different and not that maintained.
Page duplication batch action to different site would be nice to have and relatively easy to do.
This issue is about getting path to any page that is made with update-core-routes
command but forcing it's it's locale. It is not possible now as the path
twig function does not take to account the site.
I don't see why it is a problem to insert the page blocks twice. Sometimes it does not even make sense to make the same page in another language as the content is so much different and not that maintained.
Page duplication batch action to different site would be nice to have and relatively easy to do.
This issue is about getting path to any page that is made with
update-core-routes
command but forcing it's it's locale. It is not possible now as thepath
twig function does not take to account the site.
Ok I´ll create separate issue
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.