ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Need to output onto the screen 'start_on' and 'stop_before' dates

April 16, 2010 12:57pm

Subscribe [1]
  • #1 / Apr 16, 2010 12:57pm

    readio

    12 posts

    Hi All

    I have built an events section of a website and created a filter using dynamic parameters. I have set up a select for the category, start and stop dates. This works great to filter the categories and the date range.

    What I am now trying to do is output on the results page the ‘start_on’ and ‘stop_before’ dates that the user has selected to get the results. I can insert the category using the category name tag - so I have “You have searched for ‘category name’ events between” - I would like to add the dates here.

    Is this possible?

    Thanks

    Code here for filter:

    <form method="post" action="/events/results/">
            <fieldset>
                <select id="category" name="category" class="category">
                    {!--<option value="4|5|6">All Events</option>--}
                {exp:weblog:categories weblog="event" show_empty="no" style="linear" show_future_entries="yes"}
                    <option value="{category_id}">{category_name}</option>
                {/exp:weblog:categories}
                </select>
                <select id="start_on" name="start_on" class="date">
                    <option value="2010-07-10 00:01" selected="selected">10th July 2010</option>
                    <option value="2010-07-11 00:01">11th July 2010</option>
                    <option value="2010-07-12 00:01">12th July 2010</option>
                    <option value="2010-07-13 00:01">13th July 2010</option>
                    <option value="2010-07-14 00:01">14th July 2010</option>
                    <option value="2010-07-15 00:01">15th July 2010</option>
                    <option value="2010-07-16 00:01">16th July 2010</option>
                    <option value="2010-07-17 00:01">17th July 2010</option>
                    <option value="2010-07-18 00:01">18th July 2010</option>
                    <option value="2010-07-19 00:01">19th July 2010</option>
                    <option value="2010-07-20 00:01">20th July 2010</option>
                    <option value="2010-07-21 00:01">21st July 2010</option>
                    <option value="2010-07-22 00:01">22nd July 2010</option>
                    <option value="2010-07-23 00:01">23rd July 2010</option>
                    <option value="2010-07-24 00:01">24th July 2010</option>
                    <option value="2010-07-25 00:01">25th July 2010</option>
                </select>
                <select id="stop_before" name="stop_before" class="date last">
                    <option value="2010-07-10 23:59">10th July 2010</option>
                    <option value="2010-07-11 23:59">11th July 2010</option>
                    <option value="2010-07-12 23:59">12th July 2010</option>
                    <option value="2010-07-13 23:59">13th July 2010</option>
                    <option value="2010-07-14 23:59">14th July 2010</option>
                    <option value="2010-07-15 23:59">15th July 2010</option>
                    <option value="2010-07-16 23:59">16th July 2010</option>
                    <option value="2010-07-17 23:59">17th July 2010</option>
                    <option value="2010-07-18 23:59">18th July 2010</option>
                    <option value="2010-07-19 23:59">19th July 2010</option>
                    <option value="2010-07-20 23:59">20th July 2010</option>
                    <option value="2010-07-21 23:59">21st July 2010</option>
                    <option value="2010-07-22 23:59">22nd July 2010</option>
                    <option value="2010-07-23 23:59">23rd July 2010</option>
                    <option value="2010-07-24 23:59">24th July 2010</option>
                    <option value="2010-07-25 23:59" selected="selected">25th July 2010</option>
                </select>
                <input type="submit" id="submit" value="Find Events" class="submit"/>
            </fieldset>
        </form>

    Results page:

    {exp:weblog:entries weblog="{listing}" rdf="off" orderby="date" sort="asc" show_future_entries="yes" category_group="2" category="{segment_3_category_id}" start_on="2010-07-10 00:01" stop_before="2010-07-25 23:59" dynamic_parameters="start_on|stop_before|category" limit="1"}
                    
                    Your search results for <strong>{categories}{category_name}{/categories}</strong> events
                    
                    {if no_results}
                    Sorry we have no events that match your search criteria.
                    {/if}
                     {/exp:weblog:entries}    
    
                     <ul class="listing">
                     {exp:weblog:entries weblog="{listing}" rdf="off" orderby="date" sort="asc" show_future_entries="yes" category_group="2" category="{segment_3_category_id}" start_on="2010-07-10 00:01" stop_before="2010-07-25 23:59" dynamic_parameters="start_on|stop_before|category"}
                     <li>
                         <h2>{title}</h2>
    <p>                     {event-start format="%d%S %F %Y"}{if event-end} - {event-end format="%d%S %F %Y"}{/if}<br />
                         {event-summary}<br />
                         <a href="/events/event-detail/{url_title}">More information on this event.</a><br />
                     </li><br />
                     {/exp:weblog:entries}<br />
                     </ul>

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases