eZ Community » Forums » Setup & design » Fetching nodes, while excluding the...
expandshrink

Fetching nodes, while excluding the actual node

Fetching nodes, while excluding the actual node

Thursday 23 November 2006 5:19:15 pm - 2 replies

Hi,

I am still a newbie, who happens to have to build several sites with eZPublish in no time.

Anyways to the Problem:

I read the following page, explaining the list Operator of the template fetch functions.

http://ez.no/doc/ez_publish/techn...modules/content/fetch_functions/list

I understand the sorting algorithms, but I cannot find one, excluding a specific node, while displaying all other in the respective folder.

The situation: I have a a category (=folder) named e.g. "Sports". In it I store all articles related to Sports. I also build a special pagelayout for article presentation, so I have a column displaying the article ($module_result.content) and a right column displaying an ad and additional information.

The additional information should display "More related articles" and "More from this author".

So the problem is:

1.How do I fetch all other article titles of the sports section (display in additional information) without fetching the actual displayed node title, which is also a sports article.

2. How do I retrieve all other article -titles of the author of the actual node, excluding the actual node's title itself.

Since, I guess this is a common and important issue, when using eZ for a "News Site", I hope you guys can help me out....

Any help is really appreciated. thanks

and sorry if I really missed something obvious, I am an Newbie and tried to find a solution by myself, but in vain.

bye!

P.S.. I use eZ Publish 3.8.6

Friday 24 November 2006 2:13:51 pm

Anybody with an idea?

Is the description of the problem not clear?

If not, please let me know.

thanks...

Friday 24 November 2006 5:31:40 pm

Hi,

You can't solve all with the fetch functions, but the solution here would be to exclude the specific node in the template:

For example:

{def $nodes=fetch( 'content', 'list',
        hash( 'parent_node_id', 42,
              'depth', 3 ) )}
 
{foreach $nodes as $node}
    {if $node.node_id|eq(123)}
        {continue}
    {/if}
    {$node.name|wash} <br />
{/foreach}

Modified on Friday 24 November 2006 5:32:55 pm by Harry Oosterveen

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from