This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit

eZ Community » Forums » eZ Publish 5 Platform » Siteaccess in generated urls

Siteaccess in generated urls

Siteaccess in generated urls

Friday 05 April 2013 9:02:18 pm - 14 replies


I having problems generating paths in a multilingual website with URL Matching.

When using

 {{ path( location ) }}

it does not generate the url with siteaccess (p.e.

It only generate for every language.

Any clue?

Thanks in advance.

Modified on Tuesday 09 April 2013 12:24:20 pm by Kiko Magán

Tuesday 09 April 2013 5:12:41 pm


I don't know if it will work but maybe you could try with :

 {{ url( location ) }}

Tuesday 09 April 2013 5:18:37 pm

Hi Javier

What's your siteaccess match config ?

Tuesday 09 April 2013 5:22:47 pm

Hi Julien.

It does the same as the path function.

The translation of the url is working, but the site access is missing.

Wednesday 10 April 2013 11:18:16 am

Hello Jérôme.

My siteaccess match config is:


            URIElement: '1'

Thursday 11 April 2013 9:07:50 am

I also tried with:



                en: en

                es: es

                site_admin: site_admin

And the problem persist. Any help?

This is been a very serious problem for deploying a multilingual web site... 

Thank in advance.

Modified on Thursday 11 April 2013 9:08:27 am by Kiko Magán

Thursday 11 April 2013 11:07:11 am

Hi Javier

I'll check this today as I'm currently working on routing.

Thursday 11 April 2013 5:15:09 pm

Confirmed. Issue reported :

Thursday 11 April 2013 5:59:00 pm

And fixed !

Thanks !

Next time, please open an issue happy.gif Emoticon

Thursday 11 April 2013 6:13:50 pm

Thanks to you Jérôme!

I updated and it is working. Great work!

I'll open a issue next time.


Thursday 25 July 2013 5:09:18 pm

Quote from Jérôme Vieilledent :

Confirmed. Issue reported :

Hi Jérôme,

I'm having a similar issue with routes defined in symfony:
The generated paths (with container->get('router') as well as twig's path function) do not include the siteaccess.

It seems that UrlAliasGenerator.php, nor UrlAliasRoute.php never get triggered in my context, since it's a special bundle and not a path to a location. (but this is only a guess)

Also if I define the route path with a {_locale} prefix it leads to legacy kernel module error.( {_locale}  module can not be found.)

Siteaccess is properly matched and is visible in the Request.

Matching is the following:

                en: en
                de_DE: de_DE


Thanks in advance for pointing me into the right direction.

Friday 26 July 2013 3:41:10 pm

Hi Andreas

Sounds like a valid issue. Can you please open a ticket on Jira ? Thanks happy.gif Emoticon

Friday 26 July 2013 4:30:13 pm

Quote from Jérôme Vieilledent :

Hi Andreas

Sounds like a valid issue. Can you please open a ticket on Jira ? Thanks happy.gif Emoticon

Thanks for confirming. Issue is reported here.

I already started implementing a workaround by overriding and extending symfony's urlgenerator class in parameters.ym as follows:

'router.options.generator_base_class: Client\ExampleBundle\Routing\Generator\UrlGenerator

The doGenerate function the $parameters array contains the siteaccess (possibly injected by the SiteaccessListener).
The matcher then could analyze the link and prepend the siteaccess.

However, when I declared the siteaccess variable via: $siteaccess = $parameters['siteaccess'] I'm thrown an InvalidScope exception ('request' being an inactive scope)

Monday 29 July 2013 7:02:01 pm

Hi Andreas

Pull-request here:

Please test and comment it (add a +1 if it works for you).

Tuesday 30 July 2013 12:45:39 pm

Quote from Jérôme Vieilledent :

Hi Andreas

Pull-request here:

Please test and comment it (add a +1 if it works for you).

Thanks for your quick response, it works.


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from