“start_on” Parameter Available in reverse_related?
Posted: 03 June 2008 03:14 PM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  130
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 09:19 AM   [ Ignore ]   [ # 1 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  130
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 11:08 AM   [ Ignore ]   [ # 2 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  130
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
 
 
Posted: 10 March 2010 03:28 PM   [ Ignore ]   [ # 3 ]  
Grad Student
Rank
Total Posts:  37
Joined  11-19-2008

While this is an old post… it helped me out with the same issue. However, I’ve discovered that you needn’t create a custom field for expiration date. You can actually go off of “entry_date”, and it works well since your using future entries anyway.

{exp:weblog:entries weblog="myweblog"}

    {reverse_related_entries show_future_entries
="yes"}

        {if entry_date
>  current_time}

            {title}
...

        
{/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 1743, on December 02, 2009 03:47 PM
Total Registered Members: 120616 Total Logged-in Users: 98
Total Topics: 126649 Total Anonymous Users: 54
Total Replies: 665785 Total Guests: 530
Total Posts: 792434    
Members ( View Memberlist )