Appending query parameters to an internal link

Author Message

Alison Smith

Tuesday 09 September 2008 7:29:56 am

Hi, I'm looking at an analytics tracking problem which can easily be resolved if we could append a query parameter to internal links. But I'm told that this isn't possible as the query string would be stripped out. The only way round it is to enter the full URL rather than a relative link (e.g. http://www.mysite.com/mypage.htm?mypara=abc rather than /mypage.htm?mypara=abc). Is this true? Can we really not append a query parameter to a (relative) internal link?
If it's not possible then we may have to look at another CMS as it is essential for tracking that we pass parameters through in the URL for some internal links.

Gaetano Giunta

Tuesday 09 September 2008 1:56:52 pm

What is the exact meaning of "internal links"?

You can output a link to any node adding the query string in the template code, eg:

<a href="{concat($node.url_alias|ezurl(no), '?a=b')}">

The query string will then be ignored by your node template, but it can be used to do tricks wit proxies or seo.

You can also add ez-style parameters:
<a href="{concat($node.url_alias|ezurl(no), '/(offset)/10')}">
these extra params are very easy to use in the node template of the target node.

You can also create your own template operators that do custom url manipulation to make development easier.

Principal Consultant International Business
Member of the Community Project Board

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.