Fetching nodes, while excluding the actual node

Author Message

Ahmed El Safty

Thursday 23 November 2006 8:19:15 am

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/technical_manual/3_8/reference/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

Ahmed El Safty

Friday 24 November 2006 5:13:51 am

Anybody with an idea?

Is the description of the problem not clear?

If not, please let me know.

thanks...

Harry Oosterveen

Friday 24 November 2006 8:31:40 am

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}

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