Sticky News

Sticky News

Thursday 29 March 2007 5:20:57 am - 2 replies

Author Message

Sylvain Bannier

Thursday 29 March 2007 10:57:21 am

Hi,

in my opinion this order would be a little faster :
- Fetch sticky news with attribute filter = sticky (limit = 10)
- count the number of sticky news (S)
- subtracts L=10-S
- Fetch news with limit=L and attribute filter != sticky

don't you think ?

Then you could use an operator to merge and sort these nodes.

http://www.smile.fr

Nabil Alimi

Thursday 29 March 2007 11:39:16 am

Hi,

Even faster.

A single fetch where you use the sticky param to sort your result.
Something like this :

{def $list_news=fetch( content , list , hash( parent_node_id , $some_node_id , sort_by , array( array( sticky , true() ) , array( published , false() ) ) , limit , 10 , class_filter_type , 'include' , class_filter_array , array( 'news' ) ) )}

That way, you have one single fetch to deal with. :)

My blog : http://www.starnab.com/ezpublish / http://www.starnab.com/ / http://www.assiki-consulting.com
eZ Publish Freelance developper. Feel free to contact me +33 674 367 057
nabil at assiki d0t fr

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.