Forums / Developer / sent a variable in a href

sent a variable in a href

Author Message

jb bianchi

Thursday 11 August 2005 9:04:38 am

hi,

I have a problem and I need help.
How can I sent a variable in a href like it

<a href={$:item.url_alias|ezurl}>{$:item.name|wash}</a>

I want to send a variable $v='a'. I use it for a test in the next page.

Thank's.

Paul Borgermans

Friday 12 August 2005 10:17:06 am

There are a few ways to implement this.

1) Use custom variables to pass between view templates

2) Create a GET query of which the variables can be read with the ezhttp template operator.

hth

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

jb bianchi

Saturday 13 August 2005 3:05:23 am

ok,

but can I do this:

<a href={$:item.url_alias?$v='a'|ezurl}>{$:item.name|wash}</a>
and in the next page, I do v=ezhttp('v','get')
because I have already done it and each time if I write {$v} there is no value.

thank's

Gabriel R.

Saturday 13 August 2005 4:03:29 am

try it this way:

link including get variable:

<a href={concat($:item.url_alias,'?v=a')|ezurl}>{$:item.name|wash}</a>

result page:

{def $v=ezhttp('v','get'}
GET variable 'v': {$v}

gab

Gabriel Ambuehl

Saturday 13 August 2005 4:31:07 am

Or

concat(url_alias, '(name)/value')|ezurl

and retrieve the value from $view_parameters.name

Visit http://triligon.org

jb bianchi

Saturday 13 August 2005 7:15:13 am

ok thak's for your answer that help me so much.

but it is possible to do the same with this:

{attribute_view_gui attribute=$node.object.data.map_data.an_expert}
I want to send az variable too.

thank's

David Eriksson

Monday 15 August 2005 12:38:50 am

{attribute_view_gui attribute=$node.object.data.map_data.an_expert myvar=data}

Like that?

http://ez.no/doc/ez_publish/technical_manual/3_6/reference/template_functions/visualization/attribute_view_gui

/David

jb bianchi

Monday 15 August 2005 2:19:00 am

yes,

but I 'll try but there is no need to declare the variable in the next template?
thank's

David Eriksson

Monday 15 August 2005 3:53:47 am

Nope, just access it with $myvar.

/David

jb bianchi

Tuesday 16 August 2005 1:12:24 am

hi,

I'm sorry but I have done what you say to me and no result.
The variable in the next template have no value.
What I have forget to do?

thank's

David Eriksson

Tuesday 16 August 2005 1:55:01 am

I'm not quite sure how it works, it's rather mysterious. For example, this doesn't work:

{node_view_gui view=full content_node=$obj redirecttimer=$redirecttimer plasmaoffset=$module_result.view_parameters.plasmaoffset}

This, however, works:

{def $p_off=$module_result.view_parameters.plasmaoffset}
    {node_view_gui view=full content_node=$obj redirecttimer=$redirecttimer plasmaoffset=$p_off}

Perhaps that can help you.

/David

jb bianchi

Tuesday 16 August 2005 6:52:33 am

thank's I'll try.

eZ debug

Timing: Jan 18 2025 19:19:57
Script start
Timing: Jan 18 2025 19:19:57
Module start 'content'
Timing: Jan 18 2025 19:19:57
Module end 'content'
Timing: Jan 18 2025 19:19:57
Script end

Main resources:

Total runtime0.2278 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0134 588.8281180.8359
Module start 'content' 0.01340.0108 769.6641101.9922
Module end 'content' 0.02420.2035 871.6563530.0234
Script end 0.2277  1,401.6797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00371.6295200.0002
Check MTime0.00150.6610200.0001
Mysql Total
Database connection0.00301.297710.0030
Mysqli_queries0.158969.74591410.0011
Looping result0.00170.76741390.0000
Template Total0.203189.210.2031
Template load0.00080.353410.0008
Template processing0.202388.828610.2023
Override
Cache load0.00060.248110.0006
Sytem overhead
Fetch class attribute can translate value0.00160.709910.0016
XML
Image XML parsing0.00040.159410.0004
General
dbfile0.00281.2293200.0001
String conversion0.00000.003130.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0002 secs