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.

eZ debug

Timing: Jan 18 2025 19:06:35
Script start
Timing: Jan 18 2025 19:06:35
Module start 'layout'
Timing: Jan 18 2025 19:06:35
Module start 'content'
Timing: Jan 18 2025 19:06:36
Module end 'content'
Timing: Jan 18 2025 19:06:36
Script end

Main resources:

Total runtime1.2802 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0096 589.1719152.6406
Module start 'layout' 0.00960.0032 741.812539.4766
Module start 'content' 0.01271.2660 781.2891523.8750
Module end 'content' 1.27880.0014 1,305.16418.1250
Script end 1.2802  1,313.2891 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00520.4090160.0003
Check MTime0.00240.1865160.0001
Mysql Total
Database connection0.00200.155110.0020
Mysqli_queries1.223295.5438540.0227
Looping result0.00080.0637520.0000
Template Total1.234296.420.6171
Template load0.00390.307720.0020
Template processing1.230296.094720.6151
Template load and register function0.00030.019510.0003
states
state_id_array0.00240.188310.0024
state_identifier_array0.00180.140520.0009
Override
Cache load0.00350.2744150.0002
Sytem overhead
Fetch class attribute can translate value0.00090.072420.0005
Fetch class attribute name0.00170.131830.0006
XML
Image XML parsing0.00060.048120.0003
class_abstraction
Instantiating content class attribute0.00000.000730.0000
General
dbfile0.00160.1246160.0001
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 10
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs