Show contents of node?

Author Message

Neo Pixel

Thursday 11 June 2009 7:03:39 am

How do I do this? I got so far...


{def $my_node=fetch( content,
                     list,
                     hash( parent_node_id,     89,
                           limit,              15,
                           class_filter_type,  include,
                           class_filter_array, array( 'article' ) ) )}

{undef}


<!-- ZONE CONTENT: START -->

<div class="border-box">
<div class="border-tl"><div class="border-tr"><div class="border-tc"></div></div></div>
<div class="border-ml"><div class="border-mr"><div class="border-mc">
<div class="border-content">

hello titles from node id 89 !!! what do i put here???!!??!

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


</div>
</div></div></div>
<div class="border-bl"><div class="border-br"><div class="border-bc"></div></div></div>
</div>

<!-- ZONE CONTENT: END -->

Any help would be much appreciated

Asking stupid questions so you don't have to!

justin kazadi

Friday 12 June 2009 2:07:51 am

If you want to show the contents of nodes who are children of one node for example
node_id = 89 .

You can do this :

{def $my_node=fetch( content, list, hash( parent_node_id,    89,
                                                             limit,15,
                                                             class_filter_type, include,
                                                             class_filter_array, array( 'article' )
                              )
}

{foreach $my_node as $item}
              
           <div class="">
                 {attribute_view_gui attribute=$item.object.data_map.name_of_any_attribute1}
                 <br />
                 {attribute_view_gui attribute=$item.object.data_map.name_of_any_attribute2}
                 <br />
               ....... 
          </div>

{/foreach}

i think this can help you.

The theory is when we know everything and nothing works.
The practice is when everything works and nobody knows why.
If the practice and theory are met, nothing works and we do not know why.

Albert Einstein

Neo Pixel

Friday 12 June 2009 5:27:49 am

Thanks Justin

But what do I put in place of "name_of_any_attribute1" ???

Can someone gve me an example?

Asking stupid questions so you don't have to!

justin kazadi

Friday 12 June 2009 6:58:03 am

{def $my_node=fetch( content, list, hash( parent_node_id,   89,


                                                            limit,15,


                                                            class_filter_type, include,


                                                            class_filter_array, array( 'article' )


                             )


}
{foreach $my_node as $item}

          <div class="">
                {attribute_view_gui attribute=$item.object.data_map.name_of_any_attribute1}
                <br />
                {attribute_view_gui attribute=$item.object.data_map.name_of_any_attribute2}

                <br />
              ....... 
         </div>

{/foreach}

"name_of_any_attribute&" , "name_of_any_attribute2" ,"name_of_any_attribute n" are the identifier of the attribute of the class (in this fetch "article") you wanna to show in your template.

i think this doc could help you:
http://ez.no/doc/ez_publish/technical_manual/4_0/reference/modules/content/fetch_functions/list

The theory is when we know everything and nothing works.
The practice is when everything works and nobody knows why.
If the practice and theory are met, nothing works and we do not know why.

Albert Einstein

Neo Pixel

Monday 15 June 2009 1:31:45 am

Thanks Justin but I don't understand... I'm just a designer!

{def $my_node=fetch( content,
                     list,
                     hash( parent_node_id,     89,
                           limit,              15,
                           class_filter_type,  include,
                           class_filter_array, array( 'article' ) ) )}

{undef}


<!-- ZONE CONTENT: START -->

<div class="border-box">
<div class="border-tl"><div class="border-tr"><div class="border-tc"></div></div></div>
<div class="border-ml"><div class="border-mr"><div class="border-mc">
<div class="border-content">


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


</div>
</div></div></div>
<div class="border-bl"><div class="border-br"><div class="border-bc"></div></div></div>
</div>

<!-- ZONE CONTENT: END -->

This isn't it... is it?

Asking stupid questions so you don't have to!

justin kazadi

Monday 15 June 2009 2:42:52 am

Ok,

Tell me the attributes identifier of your class that you want to show content. so i would do for you.

The theory is when we know everything and nothing works.
The practice is when everything works and nobody knows why.
If the practice and theory are met, nothing works and we do not know why.

Albert Einstein

Neo Pixel

Monday 15 June 2009 5:54:34 am

(news folder) node id 89

> article title
> article summary

next etc

Title [Text line] (id:183)
Summary [XML block] (id:186)

Many thanks :-)

Asking stupid questions so you don't have to!

justin kazadi

Monday 15 June 2009 6:21:29 am

You can do this (i think title and summary are the identifiers of your desired attribute ) :

{def $my_node=fetch( content, list, hash( parent_node_id,  89,
                                                           limit,15,
                                                           class_filter_type, include,
                                                           class_filter_array, array( 'article' )
                            )
}


{foreach $my_node as $item}


         <div class="">
               {attribute_view_gui attribute=$item.object.data_map.title}
               <br /><br />
               {attribute_view_gui attribute=$item.object.data_map.summary}
               
             ....... 
        </div>

{/foreach}{undef $my_node}

i think this can help you.

good luck

The theory is when we know everything and nothing works.
The practice is when everything works and nobody knows why.
If the practice and theory are met, nothing works and we do not know why.

Albert Einstein

Neo Pixel

Wednesday 17 June 2009 3:00:46 am

Ended up doing it this way...

<!-- ZONE CONTENT: START -->
<div class="border-box">
<div class="border-tl"><div class="border-tr"><div class="border-tc"></div></div></div>
<div class="border-ml"><div class="border-mr"><div class="border-mc">
<div class="border-content">

	{def $news_node= fetch('content','node',hash('node_path','News'))}

	
	{def $children=fetch( 'content','list', hash( 'parent_node_id', $news_node.node_id,
                                                          'class_filter_type','include', 
                                                          'sort_by','modified',
                                                          'class_filter_array',array('article'),
                                                          'limit', 15 ) )}
                 
<div class="content-view-children">
<div class="attribute-header"><h1>The Week</h1></div>
<div id="right_news_menu">
            <ul id="right-news-menu-index">
            
                {foreach $children as $child }
                <li class="right-news-nenu-link"><a href="{$child.url|ezurl('no')}"> {$child.name}</a></li>
                {/foreach}
                
               </ul>
               </div>
            </div>
   
</div>
</div></div></div>
<div class="border-bl"><div class="border-br"><div class="border-bc"></div></div></div>
</div>



<!-- ZONE CONTENT: END -->

It works :)

Thanks for your help tho!

Asking stupid questions so you don't have to!

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:00:13
Script start
Timing: Jan 18 2025 11:00:13
Module start 'layout'
Timing: Jan 18 2025 11:00:13
Module start 'content'
Timing: Jan 18 2025 11:00:14
Module end 'content'
Timing: Jan 18 2025 11:00:14
Script end

Main resources:

Total runtime0.8970 sec
Peak memory usage4,096.0000 KB
Database Queries75

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0074 587.9063152.6250
Module start 'layout' 0.00740.0039 740.531339.4453
Module start 'content' 0.01130.8840 779.9766632.6328
Module end 'content' 0.89530.0016 1,412.609428.1719
Script end 0.8969  1,440.7813 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.3798160.0002
Check MTime0.00140.1507160.0001
Mysql Total
Database connection0.00140.155010.0014
Mysqli_queries0.811290.4381750.0108
Looping result0.00080.0848730.0000
Template Total0.860295.920.4301
Template load0.00200.221820.0010
Template processing0.858295.683020.4291
Template load and register function0.00020.022210.0002
states
state_id_array0.00120.129410.0012
state_identifier_array0.00140.151420.0007
Override
Cache load0.00180.2007550.0000
Sytem overhead
Fetch class attribute can translate value0.00080.084520.0004
Fetch class attribute name0.00120.1346110.0001
XML
Image XML parsing0.00220.241420.0011
class_abstraction
Instantiating content class attribute0.00000.0049180.0000
General
dbfile0.00230.2617230.0001
String conversion0.00000.001340.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
9content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
9content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
17content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
6content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
4content/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: 47
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs