ezhttp and cache

Author Message

Romain Bremaud

Sunday 21 November 2010 10:20:19 am

Hello everybody.

I know that there is several topic about this question. But I dont' find solution.

In my template I use a link like this :

<span class="Apple-style-span" style="font-size: 13px; " mce_style="font-size: 13px;" mce_fixed="1">href={concat("myurl/url?idselected=", $node.contentobject_id)|ezurl}</span>

After I use the following code to recover my id :

{if ezhttp_hasvariable( 'idselected', 'get' )}

     {def $idselected=ezhttp('idselected', 'get' )}

{/if}

But this code works only one time. I have problem with the cache.

I saw in many topics that I can use custom view parameters but I do not know how to make.

Thanks in advance for your help.

Cheers,

Romain Bremaud
Les clefs du net

Damien Pobel

Sunday 21 November 2010 11:39:51 am

Hi Romain,

in fact this is very simple. Instead of using myurl/url?idselected=XXX URL, you can use something like myurl/url/(idselected)/XXX. This kind of URL will automatically create a view parameter available in your view template with the following code :

{$view_parameters.idselected}

For more on that topic, you can read : http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Templates/Basic-template-tasks#eztoc86760_4

Cheers

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

Romain Bremaud

Moderated by: Nicolas Pastorino

Monday 22 November 2010 2:01:13 pm

Thank for you help Damien. It's work but now I have an another problem :

I lost my value between the differents templates... If I have the following code

{node_view_gui content_node=$childTmp}

In the children template I lose the value of {$view_parameters.idselected} :(

I could use a parameter like this :

{node_view_gui content_node=$childTmp id_selected=$view_parameters.idselected}

But I have too much node.

That is why I would like to use global variable like this :

{set scope='global' $total_items=0}
{$#total_items}

But this code don't works.

Have you got an idea ?

Thanks in advance.

Romain

Romain Bremaud
Les clefs du net

Romain Bremaud

Friday 26 November 2010 12:29:09 am

For resolve my problem I passed the parameters between every template. But It is a temporary solution...

Romain

Romain Bremaud
Les clefs du net

Lo' F.

Thursday 05 May 2011 7:06:23 am

"

...In my template I use a link like this :

<span class="Apple-style-span" style="font-size: 13px; " mce_style="font-size: 13px;" mce_fixed="1">href={concat("myurl/url?idselected=", $node.contentobject_id)|ezurl}</span>

After I use the following code to recover my id :

{if ezhttp_hasvariable( 'idselected', 'get' )}

     {def $idselected=ezhttp('idselected', 'get' )}

{/if}

But this code works only one time. I have problem with the cache....

"

...this way, by setting

{set-block scope=root variable=cache_ttl}0{/set-block}

it should work ...

loredanaebook.it

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