Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#73 2011-01-05 16:15:38

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: ras_if_expired (conditional, expiration, date)

You shouldn’t need a plugin.

Next event:

<txp:article_custom section="events" form="list" time="future" sort="Posted asc" limit="1" />

Following events:

<txp:article_custom section="events" form="list" time="future" sort="Posted asc" limit="3" offset="1" />

Not tried, just inspired from a site of mine where I have to do something similar (and did! :)). So let me know if it works or if it give you any hint.

Offline

#74 2011-01-05 16:23:37

szac
Member
From: Detroit-ish
Registered: 2004-09-18
Posts: 50

Re: ras_if_expired (conditional, expiration, date)

I was never able to get the time=“future” attribute to respect the post time. So as soon as the day of the event would come, the article would drop off. I would have to resort to a bunch of the conditions to get it to show as expected. Using smd_calendar, I’d just set the time of the post to after the event. The plugin does support article duration so you could add another condition for an event happening ‘right now’.

Here’s what I did for a future list of events at pack1631.org. The ‘form’ is just embedded right in the page template. Probably could be optimized further, but it has worked for me.

            <div id="events_block">
                <h2 class="content_headline">Upcoming Events</h2>
                   <ul id="events_list">
                    <txp:smd_article_event section="events" time="future" limit="100">
                        <txp:if_different>
                            <h3><txp:posted format="%B" /></h3>
                        </txp:if_different>  
                        <li>
                            <div class="event_list_title">                   
                                <div class="event_date"><txp:posted format="%d" /></div>
                                <div class="event_title"><txp:title /></div>

                                <div style="clear:left"></div>
                            </div>
                            <div class="event_desc"><txp:body /></div>
                        </li>
                    </txp:smd_article_event>
                    </ul><!--/events_list-->
            </div><!--/events_block-->

Offline

#75 2011-01-05 16:36:38

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: ras_if_expired (conditional, expiration, date)

time=“future” works for me, as long as you carefully choose the hour of the event. Past the hour (h and m), the event becomes past. I’m sure smd plugins works wonderfully, too: they always do! :) I think bici should try both methods and then pick what fits his needs.

Offline

#76 2011-01-05 16:58:27

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,099
Website Mastodon

Re: ras_if_expired (conditional, expiration, date)

Thanks to both of You! for your quick and very good responses. Suggestions greatly appreciated. I will give these a try later today at home.


…. texted postive

Offline

#77 2011-01-06 03:43:49

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: ras_if_expired (conditional, expiration, date)

Most recent incarnation of this plugin is @ ras_if_dates , but from your description I think I agree that it may not be required or the best solution. It is an article based conditional that tests for a variety of posting and expiration states, but it doesn’t have access to filter the actual content returned, only what is displayed.

Offline

Board footer

Powered by FluxBB