Hi all,
I have a question concerning the news listing.
* I have deleted and unpublished some news items, but they still show up in the NewsListing snippet. How can I get rid of those items?
Decreasing the limit works, but this is not the desired way :-)
Any ideas?
Tx,
Barry
News problems
Started by barrel, Nov 09 2004 11:32 AM
4 replies to this topic
#1
Posted 09 November 2004 - 11:32 AM
#2
Posted 09 November 2004 - 12:50 PM
Make sure the page that the newsListing shows up on isn't cached. You can also refresh the site from the admin panel. This option is under "Site" in the upper left corner.
#3
Posted 09 November 2004 - 01:05 PM
Hmm... I just notice that I am posting in the wrong forum? Apoligies for that :-/
Anyway, I found the problem.
I asked etomite to also retrieve the deleted field
And afterwards checked if the deleted field was not set:
and
That did the trick.
Barry
Anyway, I found the problem.
I asked etomite to also retrieve the deleted field
$resource = $etomite->getAllChildren($resourceparent, 'createdon', 'DESC', $fields='id, pagetitle, description, content, createdon, createdby, deleted');In stead of
$resource = $etomite->getAllChildren($resourceparent, 'createdon', 'DESC', $fields='id, pagetitle, description, content, createdon, createdby);
And afterwards checked if the deleted field was not set:
if (!$resource[$x]['deleted'])
{
$output .= "<fieldset><legend>".$resource[$x]['pagetitle']."</legend>".$rest."<br /><div style='text-align:right;'>Author: <b>".$username."</b> on ".strftime("%d-%m-%y %H:%M:%S", $resource[$x]['createdon'])."</div></fieldset>";
}
and
if (!$resource[$x]['deleted'])
{
$output .= "> <a href='[~".$resource[$x]['id']."~]'>".$resource[$x]['pagetitle']."</a><br />";
}
That did the trick.
Barry
#4
Posted 09 November 2004 - 03:23 PM
If you only wanted the published and non-deleted items to show, you could have just changed:
to
$etomite->getAllChildren
to
$etomite->getActiveChildren
#5
Posted 09 November 2004 - 03:40 PM
deanstev, on Nov 9 2004, 04:23 PM, said:
If you only wanted the published and non-deleted items to show, you could have just changed:
to
$etomite->getAllChildren
to
$etomite->getActiveChildren
Thanks! Much better
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











