| kracker 
                                                                                                                             | Thursday 14 April 2005 8:59:57 am 
                                                                 I did this just today, does anyone have some ideas on how I could improve this solution? The approach I took was to call a second fetch to get the current item's parent's name. Abbreviated:
{set parent_id=$cnews.parent_node_id}
{set parent=fetch('content','node', hash('node_id', $parent_id , limit, 1 , sort_by, array(array(published, false() )) )) }
{set news_category=$parent.name}New Objects: <br />
<span style="font-size: 11px;">
  {set news_id=344}
  {set news_limit=4}
  {let recent=fetch( content, tree, hash( parent_node_id, $news_id, limit, $news_limit, 'class_filter_type', 'include', 'class_filter_array', array( 'article' ) , sort_by, array(array(published, false() )))) }
  {section show=$recent|count|gt(0)}
    {section var=cnews loop=$recent}
      {set news_title=$cnews.name}
      {set news_intro=$cnews.data_map.intro.data_text}
      {set news_date_formated=$cnews.object.current.created |datetime( 'custom', '%m/%d/%Y @ %h:%i' )}
      {set parent_id=$cnews.parent_node_id}
      {set parent=fetch('content','node', hash('node_id', $parent_id , limit, 1 , sort_by, array(array(published, false() ) ) )) }
      {set news_category=$parent.name}
      <div style="padding-top: 2px; padding-bottom: 8px;"><span><a href="{$cnews.url_alias}" style="color:#004A84;">{$news_title|shorten(348)}</a></span><div align="right"><span style="font-style: italic;">Added to Category: {$news_category}<br /><span style="font-size: 10px; color: grey;">Released: {$news_date_formated}</span></div></div>
    {/section}
  {/section}
 {/let}
</span>
//kracker mst3k : why study industrial arts? Member since: 2001.07.13 || http://ezpedia.se7enx.com/
                                                                 | 
                                                                                                    
                                                        | Ekkehard Dörre
                                                                                                                             | Saturday 16 April 2005 2:38:39 am 
                                                                 ... and ;-)) there are more interestings thinks to look after: 
module_result <br />{$module_result|attribute(show,2)}
designkeys <br />{$DesignKeys:used|attribute(show,2)}
view_parameters <br />{$view_parameters|attribute(show)}
uri_string {$uri_string} <br />
site <br />{$site|attribute(show)}
ezinfo <br /> {$ezinfo|attribute(show)}
@Lukasz: Thank You, nice surprise ;-) ,at pinboard now. Greetings, ekke http://www.coolscreen.de - Over 40 years of certified eZ Publish know-how: http://www.cjw-network.comCJW Newsletter: http://projects.ez.no/cjw_newsletter - http://cjw-network.com/en/ez-publ...w-newsletter-multi-channel-marketing
 | 
                                                                                                    
                                                        | Bertrand Dunogier
                                                                                                                             | Monday 29 August 2005 10:41:15 am 
                                                                 Jack, don't use it in pagelayout... it works as long as ViewCaching is disabled. Once enabled, you'll run into baaaad surprises :) Use $module_result.content_info.node_id to fetch what you need (for instance) but don't use $node as is. To knowledgeable people: is it right to use .parent and .children for nodes once fetched ? With those, as far as I can see, you can theorically browse the entire structure tree in one go... like {$node.parent.parent.parent.children[0].children[1]...What's the cost of that ? |