Share » Forums » Developer » Another problem in ez 3.4.1

Another problem in ez 3.4.1

Another problem in ez 3.4.1

Saturday 14 August 2004 1:50:26 am - 5 replies

Author Message

Ole Morten Halvorsen

Monday 16 August 2004 7:39:06 am

Which part of the code is not working? The first thing I would check is if the fetch return anything. This is done with the attribute operator. After your {let category_list} insert this:

{$category_list|attribute(show)}

Also, turn on debugging and check the output for any template errors.

Ole M.

Senior Software Engineer - Vision with Technology

http://www.visionwt.com
http://www.omh.cc
http://www.twitter.com/omh

eZ Certified Developer
http://ez.no/certification/verify/358441
http://ez.no/certification/verify/272578

Mark Marsiglio

Monday 16 August 2004 7:49:12 am

If you are using this in a pagelayout.tpl instead of a full or line override template, the $node variable will not work in 3.4.

You will need to replace this with a $DesignKeys or $module_result variable instead. These can be found in the documentation.

The alternative is to reorganize your template structure to move the code into a content template rather than a pagelayout template.

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

Jack Rackham

Monday 16 August 2004 9:11:53 am

Tanks for the tip $DesignKeys:used.parent_node worked. I remember that $DesignKeys did not work in the same template in 3.3. This was because $DesignKeys was not updated the same way as $node and $module_result or something like that! EZ must have changed this in 3.4.

But how do I get the related objects part of the code to work? Yes It's a pagelayout.tpl.
In 3.3 I solved this problem with not caching this part of the code but in 3.4 I don't have this alternative.

Ole Morten Halvorsen

Tuesday 17 August 2004 1:20:20 am

Jonny,

You can fetch the current node in the pagelayout which will let you access the related objects:

{let curr_node=fetch( content, node, hash( node_id, $module_result.node_id ) )}

<b>Note</b>: this fetch will not return a node on pages which does not have a node, such as /content/search, /user/login and so on.

Senior Software Engineer - Vision with Technology

http://www.visionwt.com
http://www.omh.cc
http://www.twitter.com/omh

eZ Certified Developer
http://ez.no/certification/verify/358441
http://ez.no/certification/verify/272578

Jack Rackham

Tuesday 17 August 2004 11:22:04 pm

So my code will be something like this?

{let curr_node=fetch( content, node, hash( node_id, $module_result.node_id ) )}
{section show=$related_objects}

<div class="relatedarticles">
<h2>{"Relaterte artikler"|i18n("design/magasinet/layout")}</h2>
<ul>
{section name=ContentObject loop=$related_objects show=$related_objects}
<li><a href={$ContentObject:item.main_node.url_alias|ezurl}>{$ContentObject:item.name}</a></li>
{/section}
</ul>
</div>
{/section}
{/let}

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu