eZ Community » Forums » Developer » Calling a ezurl from inside a template
expandshrink

Calling a ezurl from inside a template

Calling a ezurl from inside a template

Thursday 18 February 2010 7:49:04 pm - 2 replies

Hi, I have override templates for different classes and what I need to do is call a complete ezurl (localhost/cms/index.php/manage/People/John) from within a City override tpl. In other words, when I send in the URL for City (localhost/cms/index.php/manage/Town/Paris), somewhere in there I want to call the link for John which will then drop in the content generated from his own override template.

Thanks.

Friday 19 February 2010 10:09:28 am

Many solutions are available:

  • if the city node does not exist, you can set up an url alias for the person node
  • even if the city node does exist, set up an url alias for the person node (url aliases are taken into account before node urls). This might have the side effect of changing the url for the city though
  • fetch in the city template the person node, use its .url_alias attribute and do a redirect to it. Since redirects are better done from within the pagelayout, you can use the persistent_variable to pass the new url from the node template to the pagelayout. In the pagelayout you can output an html meta redirect tag, or you can create your own http_header template operator that will do a real http redirect
  • fetch in the city template the person node and use content_view_gui to display its template, without doing a redirect

Friday 19 February 2010 5:47:13 pm

Thank you Gaetano for giving such a detailed reply. This really helps, appreciate it.

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from