excluding duplicates in a template

excluding duplicates in a template

Thursday 31 March 2005 10:33:40 am - 5 replies

Modified on Thursday 31 March 2005 9:11:41 pm by Christiane Kloss

Author Message

Łukasz Serwatka

Thursday 31 March 2005 9:31:46 pm

Hi Christiane,

main_node_only should help, have you tried?

{let termine=fetch( 'content', 'tree', hash( 'parent_node_id', 168,
                                             'class_filter_type',  'include',
                                             'class_filter_array', array( 'termin' ),
                                             'depth', '5',
                                             'main_node_only', true() ) )

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Christiane Kloss

Friday 01 April 2005 2:04:42 am

Hi Lukasz!

Sorry, can't use it, as the main_nodes are located in the media section. Which I want to use as a data-pool even for another sideaccess.
And I want to generate links to the nodes...

I tried the codesnippet with section-exclude, section-include, match...
but the result is always the same.

Now I found out, the condition will be checked properly, when the code looks like this:

{section show=array('216')|contains( $termin.contentobject_id )}

But it is not working for the global array $objects.
How do I have to call my array objects in the showcondition ?

Greetings

Christiane

Łukasz Serwatka

Friday 01 April 2005 2:20:47 am

This should work, test it please ;)

{let termine=fetch( 'content', 'tree', hash( 'parent_node_id', 168,
                                             'class_filter_type', 'include',
                                             'class_filter_array', array( 'termin' ),
                                             'depth', '5' ) )
     objects=array()
     nodes=array()
}

{section var=termin loop=$termine}

	{section show=$objects|contains( $termin.contentobject_id )}

	{section-else}
		{set objects=$objects|append( $termin.contentobject_id )}
		{set nodes=$nodes|append( $termin.node_id )}
	{/section}	
	
{/section}

{section var=termin loop=$termine}
	{section show=$nodes|contains( $termin.node_id )}
		<p>{$termin.name}</p>
    {/section}
{/section}

{/let}	

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Christiane Kloss

Friday 01 April 2005 2:53:20 am

Hi Lukasz!

Thanks a lot - it's working!!! Jippieh

But you have to admit I was close to the right way..;-)
I still have problems to fully understand the {set..}, {set-block...}, {append-block...} statements, which statement to use in which case.
May be sometimes its better, not to think too much before but just give it try.... ;-))

Greetings Christiane

Łukasz Serwatka

Friday 01 April 2005 3:39:41 am

Great :) I`m glad I could help you :)

Here you can read more about {set-block}
http://ez.no/ez_publish/documentation/reference/template_functions/variables/set_block

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.