Fiona Hisa
|
Monday 12 November 2007 7:44:18 pm
hi, everyone I create a news folder and there are several articles in it. I want to display the articles according to the publish date. but just from the second one, that is doesn't display the latest published article.
{let children=fetch( content, list, hash( parent_node_id, $node.node_id,
limit, 10,
class_filter_type, include,
class_filter_array, array( 'article' ),
sort_by, array( 'published', false() )
) )}
what filter should I add?
extended_attribute_filter?
how to use? thanks in advance!
|
Gunnar Birkeland
|
Monday 12 November 2007 9:24:58 pm
Hi Lost. Why not make two fetches? One for the ten latest
{let children=fetch( content, list, hash( parent_node_id, node.node_id, limit, 10, class_filter_type, include, class_filter_array, array( 'article' ),sort_by, array( 'published', false() ) ) )}
And one for the other (based on your sort criteria.)
{let selectedChild=fetch( content, list, hash( parent_node_id, node.node_id, limit, 1, class_filter_type, include, class_filter_array, array( 'article' ),sort_by, array( 'YOURCRITERIA', false() ) ) )}
If the 'selectedChild' exits in the 'children' array you could easily extend the limit by one or exclude the 'selectedChild' from the 'children' search. gl
</major>
----------------------------
ez-version: 3.9.3.
PHP: 4.4.2-1
MYSQL: 4.0.24
|
Gunnar Birkeland
|
Monday 12 November 2007 9:31:12 pm
But hey, why not make it simple. Ill add this up to the "early morning, cold country" list;) The use of offset would off course be the best here. Add
...
'offset', 1,
...
to your fetch (or maybe it should be 2?, not quite sure) http://ez.no/doc/ez_publish/technical_manual/3_10/reference/modules/content/fetch_functions/list gl
</major>
----------------------------
ez-version: 3.9.3.
PHP: 4.4.2-1
MYSQL: 4.0.24
|
paul bolger
|
Wednesday 14 November 2007 4:10:24 pm
Take a look at this article, actually by Bård Farstad, although for some reason the article list says its by Sandro Groganz. http://ez.no/developer/articles/building_a_custom_template_for_a_news_portal
Paul Bolger
|