Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: ras_if_expired (conditional, expiration, date)
rick, i totally appreciate your ongoing efforts on the article posting date related issues.
now… if one could add an option to actually completely delete an article, if it has expired!
i am looking into the txplib_wrapper.php and find this function:
deleteArticleID($article_id)
wouldn’t it make sense to implement an attribute to the ras_disable_articles, like delete=“y”, which could take care of this?
with a feature like this, textpattern could be serving large sites full of classifieds (with expiration dates) or anything similar.
i know i am fantasizing, but well….
best greets, janek
A hole turned upside down is a dome, when there’s also gravity.
Offline
#38 2006-10-30 23:51:35
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: ras_if_expired (conditional, expiration, date)
Disabling content display and deleting an article are tasks that are quite different. If I understand what you would like to see happen here, using a conditional test in an article form to initiate deletion of an article, a lot of things can happen that are out of control in terms of circumstances.
Given that the article form is called and the correct info is availble to that form, it could be done. But I think a seperate function would be required and there is no reason not to use it as a seperate tag, gimme some time with it :) BTW I love the new ideas, they are always more than welcome.
Offline
Re: ras_if_expired (conditional, expiration, date)
hey rick 8-)
most important: no hurry!
and: i had started a thread about article deletion here
there’s some good indicators already, which way could be gone. still i guess we have the same problem: not much time for development right now. nevertheless: we’ll get there, i am sure.
(simultaneously working on multilingual blog stuff… and a cd shop in textpattern… ouch…)
best greets janek
A hole turned upside down is a dome, when there’s also gravity.
Offline
Re: ras_if_expired (conditional, expiration, date)
hi, very neat plugin. i believe this is still the most up-to-date way to display just today’s articles?
so two problems i have so far using <txp:ras_if_dates_today>
the first is you have to set the date, or else you get an error in testing mode. which seems weird to me cause shouldn’t it know what the date is from the database? i dont think i understand that correctly.
the second problem is i’m trying to use the <txp:else /> to give me the conditional if there are no articles for today to spit back the message “sorry nothing happening”. but it seems to spit out the message regardless of there being an article or not. thanks
Offline
#41 2008-06-30 13:23:49
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,311
Re: ras_if_expired (conditional, expiration, date)
mrtunes wrote:
i believe this is still the most up-to-date way to display just today’s articles?
I think it is at least the easiest way.
the first is you have to set the date, or else you get an error in testing mode. which seems weird to me cause shouldn’t it know what the date is from the database?
Yes, it should, and it does: I don’t get any errors without inserting a date. Have you looked for things like using curly quotes instead of straight ones in any of your tags or forgotten to close a tag?
Please post the tag and the error here if the error keeps coming. I think if we got this running the second issue will be gone :)
You can also try my (simplified) code and see how it works:
<txp:ras_if_dates_today>
<h3><txp:permlink><txp:title /></txp:permlink></h3>
<txp:body />
<txp:else />
</txp:ras_if_dates_today>
Create an article type of form on the form tab for it and choose this form for the articles you want only to show on the current date.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#42 2008-06-30 14:14:38
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: ras_if_expired (conditional, expiration, date)
If what you are using is in fact called ras_if_expired, you are probably using an early variation of this plugin. The most recent and thoroughly tested versions are available here. The differences have to do with the tag builders and don’t affect the tags, but matching versions to TXP versions can avoid some annoyance.
Offline
Re: ras_if_expired (conditional, expiration, date)
uli wrote:
Yes, it should, and it does: I don’t get any errors without inserting a date. Have you looked for things like using curly quotes instead of straight ones in any of your tags or forgotten to close a tag?
Please post the tag and the error here if the error keeps coming. I think if we got this running the second issue will be gone :)
thanks, i realized that i had to use the setdate cause i wasn’t using the </txp:else> command as the error seems to be gone now. or something else fixed it?
but it’s still not showing it conditionally:
<txp:ras_if_dates_today>
<h3><txp:title /></h3>
<txp:body />
<h2>Start Time: <txp:custom_field name=“time” /><br/>
Venue: <txp:custom_field name=“venue” /><br/>
Price: <txp:custom_field name=“price” />
</h2>
</txp:else>
Nothing’s good today
</txp:ras_if_dates_today>
—-
Nothing’s good today shouldn’t show up if there’s no articles meeting the requirements
i’m using if dates v4.0.5.1 on txp 4.0.6 (sorry for not posting that earlier)
Last edited by mrtunes (2008-06-30 19:52:36)
Offline
#44 2008-06-30 20:44:19
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,311
Re: ras_if_expired (conditional, expiration, date)
As I presumed: </txp:else>
is not the desired valid form of “else”, change it to <txp:else />
. If that isn’t sufficient yet – though it should be – try downloading the plugins for 4.0.6 if_dates is contained herein.
When you post code, please use the textile commands for posting code as shown in the help under each posting form text area. This way we can unequivocally see whether someone has used the wrong, i.e. curly quotes which is often enough another simple reason for errors. Thanks :)
Last edited by uli (2008-06-30 20:47:47)
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#45 2008-06-30 21:02:28
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: ras_if_expired (conditional, expiration, date)
Textpattern will return all the article content that the article tag calls for. ras_if_dates will select content on an article by article basis as set by the tag criteria for display if true for the set date or date range, and will display what is set in the tag arrangement (including article content) after the else clause when the date or date range does not fall into what is set by attribute or tag arrangement. The article tag still controls returned content, including navigation statistics.
Offline
Re: ras_if_expired (conditional, expiration, date)
As I presumed: </txp:else> is not the desired valid form of “else”, change it to <txp:else />. If that isn’t sufficient yet – though it should be – try downloading the plugins for 4.0.6 if_dates is contained herein.
hi, i kept trying to put it in textile posting code, but it just wouldn’t play with me. ok so i tried updating the plugin, i also fixed the else / – but still no avail. it now outputs “There is nothing good today” two times after which signifies there are two other articles that we’re not seeing because they are posted on different days.
<txp:ras_if_dates_today>
<h3><txp:title /></h3>
<txp:body />
<h2>Start Time: <txp:custom_field name="time" /><br/>
Venue: <txp:custom_field name="venue" /><br/>
Price: <txp:custom_field name="price" />
</h2>
<txp:else />
Nothing's good today
</txp:ras_if_dates_today>
Last edited by mrtunes (2008-06-30 21:12:37)
Offline
#47 2008-06-30 22:05:41
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,311
Re: ras_if_expired (conditional, expiration, date)
There are a lot of options to keep in mind in order for this to work. What you should check (ordered by likeliness):
- Are there articles with all of the following three criteria
- the right choice for “override form” (the one with the ras tags in it)
- a date set to today (checkbox for
Set timestamp to now
) - with status “live”
- If you still get no articles displayed: Do you filter away articles by any of the following
- restrictions in your article tags (category, section, custom field, etc.)
- filtering by conditionals wrapped around the article tags
Are there two article tags calling articles, on eitherFinally understand your sentence about the double messagesyour page, orin any of your forms
If all this doesn’t give you the one hint, please post the page (or form) where the article tag(s) appear.
Edit: Because you’ve written the else tag the wrong way twice, maybe this is a “habit”. Look for further occurrences of else
, applying smd_where_used helps a lot for locating occurrences of any kind of tag/form/page name/plugin/term used.
Last edited by uli (2008-06-30 22:44:42)
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: ras_if_expired (conditional, expiration, date)
thanks for the checklist. i’m sure that most of this criteria has been met, so i’ll just reiterate my problem and what i think the solution should be. i do have this plugin working correctly, it’s pulling the right articles up. it’s this else thing that isn’t working. so here is my default page code:
<div id="content">
<txp:article_custom form="article_listing" limit="5" pgonly="0" />
</div>
so instead of doing this conditional in my form, why not add something to my default page that says, “if none of these custom articles from article_listing are pulled up, display a message that says, yada”. from what i understand there is no if_article_custom tag but is there some sort of plugin to fix this?
Offline