eZ Community » Forums » eZ Publish 5 Platform » Legacy modules: Routing fallback &...
expandshrink

Legacy modules: Routing fallback & sub-requests

Legacy modules: Routing fallback & sub-requests

Thursday 06 June 2013 11:58:55 am - 10 replies

I read page https://confluence.ez.no/display/EZP/Legacy+code+and+features

So, I run a page with non legacy siteaccess.

My template:

...

{% block content %}
    {{ render( url('content/view/sitemap/2') ) }}
{% endblock %}

...

When running page,the error appeared:

"An exception has been thrown during the rendering of a template ("None of the chained routers were able to generate route: Route 'content/view/sitemap/2' not found"blunk.gif Emoticon in TmnTgkmBundle::legacy.html.twig at line 5."

 

Some information:

+ My controller inherrits eZ\Bundle\EzPublishCoreBundle\Controller

+ My action funtion very simple:

    public function homeAction()
    {
        return $this->render( "TmnTgkmBundle::legacy.html.twig" );
    }

Thursday 06 June 2013 4:26:33 pm

Hi,

If I understand, you try to access to http://yoursite.com/content/view/sitemap/2, but you are speaking of a controller with a "home" action. Do you call it in your twig template as a sub-request?

Did you try to connect as admin and see if it works ?

Friday 07 June 2013 4:04:31 am

Hi,

You understood correctly.

I tried to connect as admin, but it did not work.

Friday 07 June 2013 2:44:54 pm

Why don't you use http://yoursite.com/content/view/sitemap/2 directly in your browser ? 

You don't have to call a controller and a template, to lauch this url. 

Sunday 09 June 2013 3:34:37 pm

I want to embed sub-request in my template.

If yes, I will try some legacy module function in Symfony stack.

Example, I will embed an 'ezoe' xhtml edit field to my template. And so on...

Tuesday 11 June 2013 8:23:18 am

Hi,

Let's say that your sitemap controller name is "SitemapController" and it takes a $locationId parameter, you can call it by:

{% render controller('TmnTgkmBundle:Sitemap:home', { 'location_id': 2 }) %}

Have a nice day,

Romain.

PS: You would have better luck on a Symfony forum.

Tuesday 11 June 2013 11:01:10 am

My question is why sub-request {{ render( url('content/view/sitemap/2') ) }} don't work ? Is the documentation written in principle, not in practice ?

Tuesday 11 June 2013 11:12:18 am

Quote from Nguyen Tien Hy :

My question is why sub-request {{ render( url('content/view/sitemap/2') ) }} don't work ? Is the documentation written in principle, not in practice ?

Hi

There is probably a bug behind this... Could you please report it on Jira ?

Thanks

Thursday 13 June 2013 4:41:38 am

Hi,

I have reported the bug as the issue EZP-21052 on jira.

Thank you.

Thursday 25 July 2013 6:17:56 pm

Pull-request: https://github.com/ezsystems/ezpublish-kernel/pull/470

The fix will most likely be shipped with 2013.07.

Friday 26 July 2013 12:08:55 pm

Fixed in master.

Thanks for reporting !

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from