ezFlow: How to get node properties..!?

Author Message

Michael Fürst

Wednesday 06 August 2008 6:41:25 am

Hi there,

Short question:
Is there a way to access the node properties from a ezFlow Block? The only variable that is awailable is $block. $node or $module_result are unavailable in the block template.

Does anyone have an idea? I'd like to display the "name" attribut of the actual node in a block placed on this node / site.

Tanks a lot & bye,
Mike

Marvix Marx

Thursday 07 August 2008 12:08:59 am

I have the same problem ...
http://ez.no/developer/forum/developer/ezflow_bug_can_t_view_passed_vars_how_please

But try $#node ...

Bin LIU

Thursday 07 August 2008 2:26:15 pm

Hi,

You can override the frontpage.tpl
the line :


{attribute_view_gui attribute=$node.object.data_map.page}
 

By :


{attribute_view_gui attribute=$node.object.data_map.page node=$node view_parameters=$view_parameters [and all you want ... ...]}
 

Then you have the $node in zone.

=== Lagardère Active ===

Fetch random
http://projects.ez.no/la_fetch_random
LA Static Cache
http://projects.ez.no/lastaticcache
LA Bookmarks (jquery)
http://projects.ez.no/labookmark
LA Calendar (jquery)
http://projects.ez.no/lacalendar

My site ez
http://lingping.info

Michael Fürst

Wednesday 03 September 2008 5:25:33 am

Hi,

Thanks for this idea, but it seems not to work.
I've created a new override tpl for frontpage.tpl. Override works.

I used node as parameter in this frontpage.tpl:

<div class="content-view-full">
    <div class="class-frontpage">
	    <div class="attribute-page"
	    	{attribute_view_gui attribute=$node.object.data_map.page node=$node}
	    </div>
    </div>
</div>

And in my eZFlow Block on a "frontpage" i try to get the $node parameter:

{$node|attribute(show,1)}

But it seems that $node is null...
Do you have any other idea??

Thanks a lot & regards,
Michael

Sebastiaan van der Vliet

Wednesday 03 September 2008 5:32:13 am

Hi,

Did you try this one already?

In pagelayout.tpl, add:

{def $this_node=fetch('content','node', hash( 'node_id', $module_result.node_id))}
{set scope='global' $var='this_node'}

$this_node is then available in the block templates as $#this_node.

Certified eZ publish developer with over 9 years of eZ publish experience. Available for challenging eZ publish projects as a technical consultant, project manager, trouble shooter or strategic advisor.

Michael Fürst

Wednesday 03 September 2008 5:50:22 am

Hi,

I just found out that i need to pass $node also throug the zone layout:

<b>frontpage.tpl:</b>

{attribute_view_gui attribute=$node.object.data_map.page node=$node}

<b>2zoneslayout1.tpl: (your zone file)</b>

{block_view_gui block=$block node=$node}

<b>myezflowblock.tpl (Block Template where node ID is required)</b>

{$node.node_id} -> WORKS!

Thanks for your inputs!
Ciao,
Mike

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 31 2025 00:22:07
Script start
Timing: Jan 31 2025 00:22:07
Module start 'layout'
Timing: Jan 31 2025 00:22:07
Module start 'content'
Timing: Jan 31 2025 00:22:07
Module end 'content'
Timing: Jan 31 2025 00:22:07
Script end

Main resources:

Total runtime0.0222 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0044 588.2500151.2266
Module start 'layout' 0.00440.0033 739.4766220.7031
Module start 'content' 0.00770.0130 960.17971,005.9141
Module end 'content' 0.02070.0015 1,966.093837.9922
Script end 0.0222  2,004.0859 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002511.2722140.0002
Check MTime0.00114.7701140.0001
Mysql Total
Database connection0.00073.339610.0007
Mysqli_queries0.00208.858730.0007
Looping result0.00000.045110.0000
Template Total0.00114.910.0011
Template load0.00093.861110.0009
Template processing0.00020.972310.0002
Override
Cache load0.00062.773010.0006
General
dbfile0.00167.069880.0002
String conversion0.00000.022540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

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

Time used to render debug report: 0.0001 secs