Forums / Setup & design / Show contents of node?

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!

eZ debug

Timing: Jan 18 2025 04:06:55
Script start
Timing: Jan 18 2025 04:06:55
Module start 'content'
Timing: Jan 18 2025 04:06:55
Module end 'content'
Timing: Jan 18 2025 04:06:55
Script end

Main resources:

Total runtime0.0143 sec
Peak memory usage2,048.0000 KB
Database Queries4

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 587.7031180.8438
Module start 'content' 0.00470.0046 768.5469109.9766
Module end 'content' 0.00930.0049 878.523486.7031
Script end 0.0142  965.2266 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002316.2808120.0002
Check MTime0.00107.2111120.0001
Mysql Total
Database connection0.00064.215610.0006
Mysqli_queries0.002315.947440.0006
Looping result0.00000.091720.0000
Template Total0.004631.910.0046
Template load0.00117.739510.0011
Template processing0.003424.093610.0034
Override
Cache load0.00074.655710.0007
General
dbfile0.00021.5736100.0000
String conversion0.00000.028330.0000
Note: percentages do not add up to 100% because some accumulators overlap

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.0001 secs