-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
[NodeBundle] link select language problem #1159
Comments
I think we can even do this for getting the base url:
|
But when some1 select the link in dev mode, then the base will be /app_dev.php/ and that will be saved I guess. This is why i posted that ugly scriptname remove hack (but still don't like it). |
This was referenced May 23, 2016
I just submitted a pull request that fixes this #1224 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The url chooser works only with multilanguage sites now: https://github.com/Kunstmaan/KunstmaanBundlesCMS/blob/master/src/Kunstmaan/NodeBundle/Resources/views/Widgets/selectLink.html.twig#L83
In this file:
data-base-url={{ "/" ~ app.request.locale }}
is the problematic piece, cause locale is not needed in the url on single language settings.The fix should be simple, just
{{ multilanguage ? "/" ~ app.request.locale : '' }}
, but that multilanguage parameter is not accessible in twig (and cant access the container either).The other parameters are defined in config.yml, which is in a different package, and putting the
multilanguage: %multilanguage%
line there would be very easy but also a bc break.So, what do you think, is it okey to fix this way or have a better idea?
Other approach would be a prod url generator, which just replaces the scriptname from the generated url (this is big hax and not recommended). A twig extension in NodeTwigExtension would be for this (with needs_context => true):
The text was updated successfully, but these errors were encountered: