“start_on” Parameter Available in reverse_related?
Posted: 03 June 2008 02:14 PM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  109
Joined  09-17-2007

Hello,

Does anyone know if the start_on parameter is available for use when calling reverse_related entries?

For example, I have a list of concert venues.  Each venue’s detail page will pull an upcoming concert schedule from an “events” weblog.  I only want the future events to be displayed.

Here’s my code snippet:

{exp:weblog:entries weblog="venues" limit="1"}
<!-- lots of custom field stuff displaying here -->
<
h3>Upcoming Events at {title}</h3>
{reverse_related_entries sort="asc" orderby="entry_date" show_future_entries="yes" start_on="{current_time format='%Y-%m-%d 00:00 00'}"}
  
<h5>{title}</h5>
  <
p>{entry_date format="%m %d, %Y"}</p>
{/reverse_related_entries}
{
/exp:weblog:entries}

Thanks for your help!

Profile
 
 
Posted: 04 June 2008 08:19 AM   [ Ignore ]   [ # 1 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  109
Joined  09-17-2007

So, I’ve discovered that “start_on” may not be available via reverse_related.

I looked at the solution proposed by the folks in that thread, but unfortunately I have a slightly different situation:

Members and non-members will be submitting events to the site, and I was sort of trying to avoid having them enter an expiry date for the event.  If I absolutely have to, I will, but I want the entry form to be as simple as possible.  However, even if I use an expiration date field, “reverse_related” doesn’t allow for the use of “expiration_date”.

So aside from creating custom fields for the end date, is there another solution someone might be able to propose?  Is there a PHP way of doing this that someone could point me to?

Thanks!

Profile
 
 
Posted: 04 June 2008 10:08 AM   [ Ignore ]   [ # 2 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  109
Joined  09-17-2007

Sorry to continue a conversation with myself, but I think I’ve accomplished what I was trying to do, but I DID have to use a custom “expiration date” field that I named “events_expirydate” and I’ll display on my “create an event” form as “Display this event until:”

Code snippet on my venue details page:

{exp:weblog:entries weblog="venues" limit="1"}
<!-- a lot of custom fields outputting here -->

<
h3>Upcoming Events at {title}</h3>

{reverse_related_entries sort="asc" orderby="entry_date" show_future_entries="yes"} {!-- pull events that have an entry date in the future aka "upcoming events" --}
{if events_expirydate
> current_time} {!-- if the custom field named "events_expirydate" is greater than the current time, display the fields below --}
<h5>{title}</h5>
<
p>{entry_date format="%Y %m %d"}</p>
<!--
more custom field output here -->
{/if}
{
/reverse_related_entries}
{
/exp:weblog:entries}

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64908 Total Logged-in Users: 34
Total Topics: 81852 Total Anonymous Users: 21
Total Replies: 440059 Total Guests: 231
Total Posts: 521911    
Members ( View Memberlist )