You are not logged in.
Greetings all. I hope someone can help with my seemingly simple yet sticky puzzle to do with expired articles
I have Publish expired articles? set to yes in the advanced preferences tab.
My articles are for theatre performance runs where start time is the Timestamp date and time and end time is the Expires date and time.
My page shows two lists of articles:
A. what’s on right now (i.e. where the start time is past and the end time is in the future).
B. what’s coming up (i.e. start time is in the future).
B. is easy… this works:
<txp:article_custom pgonly="0" section="productions" time="future" listform="whatsongrid_next" sort="Custom_4 asc"/>
A. sounds easy — and with Publish expired articles? set to the default no it is… this works:
<txp:article_custom pgonly="0" section="productions" listform="whatsongrid_now" time="past" sort="Custom_4 asc"/>
But when Publish expired articles? is set to yes it outputs ALL expired articles in the section.
I tried using
if_expired in the list form and although it works its probably not a good solution from an overhead pov (especially as there will be hundreds of expired articles):
<txp:if_expired><txp:else /><txp:permlink><txp:title /></txp:permlink></txp:if_expired>
I think saccade has identified the problem in his post in the Feature Ideas forum Expired Articles: Finetuning and his proposed tag attribute solution works perfectly for me (many thanks saccade!), but, unless this is officially adopted, for obvious reasons I’d much rather find a plug-in, workaround or inline php solution to this.
Does anyone have any suggestions? Thanks.
Last edited by woof (2009-07-04 17:01:36)
I don’t know how it stacks up from the point of view of overhead, but you could use the odd little plugin I just published yesterday. I was already thinking of un-publishing it owing to the direction of this thread, but what you’re requesting is one of the other useful things about the plugin.
Hi J Soo
Cheers – I tried out your plugin earlier and I could be mistaken but it seemed I couldn’t get it to exclude expired articles in the output. I’m going to revisit it right now, give it another go and see how I get on. Thanks.
Hmm, appears to be quite FUBAR’d. Let me have a look…
Edit: Okay, I think I’ve fixed it.
Last edited by jsoo (2009-07-04 19:19:31)
Okay, I think I’ve fixed it.
Cheers – I was just about to reply to say I gave it another go and still can’t seem to get your plugin to achieve what I’m looking for – though I feel the capability is probably close.
fingers crossed and thanks for your help
Thanks for the fix jsoo but unfortunately I still can’t seem to get it to work for what I’m trying to achieve
I want to exclude all articles with an expired value from what is returned by the article tag when time =“past” and publish expired articles is yes
So if I had three articles with timestamp and expiry ranges as follows, today (4 July 09) it would show only B.
A. 01 Jan 09 – 30 April 09
B. 01 May 09 – 31 August 09
C. 01 Sept 09 – 31 Dec 09
Using version 0.2 of the plugin, I have just set up a group of articles with the exact Posted and Expires dates you list in your example. Using this code:
<txp:soo_article_filter expires="future"> <txp:article time="past" /> </txp:soo_article_filter>
shows only article B.
Edit: Is your site in debugging mode? If you’re getting the “Not unique table/alias” error you will need to use the alternate version of the plugin.
Last edited by jsoo (2009-07-04 20:09:26)
Excellent – It works! – sorry for confusion, not sure why it didn’t work first time.
I’m using the standard version of the plug-in and it works ok – btw the alternate version in the current download archive seems to have corrupted – when I open it its just an error message rather than the expected plugin code.
Thanks for your help and a really useful plug-in. Woof
btw the alternate version in the current download archive seems to have corrupted – when I open it its just an error message rather than the expected plugin code.
Oops — fixed. Thanks for pointing it out, and glad the plugin’s working for you!