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.