Current URL

Author Message

namita varshney

Monday 03 January 2011 5:27:29 am

How to get current URL from the browser?

Alain Sahli

Monday 03 January 2011 5:58:20 am

Hi Namita,

You can use the $requested_uri_string which comes from the pagelayout. For more information see this documentation page : http://doc.ez.no/eZ-Publish/Technical-manual/4.4/Templates/The-pagelayout/Variables-in-pagelayout

http://www.wess.ch
eZ Publish Certified developer : http://auth.ez.no/certification/verify/272583

namita varshney

Tuesday 04 January 2011 4:22:20 am

$requested_uri_string will provide me the system URL.

But I want the Current compete URL from browser address bar.

Thanks

Namita

Nicolas Pastorino

Tuesday 04 January 2011 7:17:52 am

"

$requested_uri_string will provide me the system URL.

But I want the Current compete URL from browser address bar.

"

Hi Namita,

You can generate the full URL using the 'ezurl' operator :

<a href={$requested_uri_string|ezurl( '','full')}>Current URI</a>

When requesting a content/view/<view-mode>/<node-id> type of URL, you should get the URL Alias (friendly URL, not system one) in the $requested_uri_string variable, then leading to the generation of the URL seen in the browser's address bar.

Let us know how things go,
Cheers,

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

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 11:41:54
Script start
Timing: Jan 18 2025 11:41:54
Module start 'layout'
Timing: Jan 18 2025 11:41:54
Module start 'content'
Timing: Jan 18 2025 11:41:55
Module end 'content'
Timing: Jan 18 2025 11:41:55
Script end

Main resources:

Total runtime0.8375 sec
Peak memory usage4,096.0000 KB
Database Queries64

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 587.7891152.6094
Module start 'layout' 0.00550.0032 740.398439.4063
Module start 'content' 0.00870.8274 779.8047594.9375
Module end 'content' 0.83600.0014 1,374.742212.2031
Script end 0.8375  1,386.9453 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.3590160.0002
Check MTime0.00120.1410160.0001
Mysql Total
Database connection0.00110.130010.0011
Mysqli_queries0.781293.2766640.0122
Looping result0.00080.0954620.0000
Template Total0.806596.320.4033
Template load0.00200.235320.0010
Template processing0.804696.066120.4023
Template load and register function0.00030.030010.0003
states
state_id_array0.00110.131110.0011
state_identifier_array0.00190.229720.0010
Override
Cache load0.00170.2045260.0001
Sytem overhead
Fetch class attribute can translate value0.00100.118730.0003
Fetch class attribute name0.00110.136460.0002
XML
Image XML parsing0.00120.139030.0004
class_abstraction
Instantiating content class attribute0.00000.001560.0000
General
dbfile0.00180.2125220.0001
String conversion0.00000.001240.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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1content/datatype/view/ezxmltags/quote.tpldatatype/ezxmltext/quote.tplextension/ezwebin/design/ezwebin/override/templates/datatype/ezxmltext/quote.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 9

Time used to render debug report: 0.0001 secs