Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
Hello,

Is there a way to search posts by date range?
I tried using the following code:

Code: Select all
<cms:form name="quicksearch" id="quicksearch" anchor='0'>
    <cms:if k_success>
        <cms:set my_start_on=frm_start_on  scope='global'/>
        <cms:set my_stop_before=frm_stop_before  scope='global'/>
    </cms:if>

    <div>
        <label>Start Date</label>
        <cms:input type="text" name="start_on" id="start_on" />
    </div>
    <div>
        <label>Before Date</label>
        <cms:input type="text" name="stop_before" id="stop_before" />
    </div>

    <div class="buttonset">
        <cms:input type="submit" class="fbsubmitbtn" value="Start Searching!" name="submit"/>
    </div>
</cms:form>


In the "content_list.html" file.

Next, I have updated the "content_list_inner.html" page, to change the "start_on" and "stop_before" parameters for the <cms:pages...> part. So now it looks like this:

Code: Select all
...
<cms:pages
                masterpage       = k_template_name
                id               = k_selected_pageids
                folder           = k_selected_foldername
                orderby          = k_selected_orderby
                order            = k_selected_order
                custom_field     = k_selected_custom_field
                paginate         = '1'
                limit            = k_selected_limit
                show_unpublished = '1'
                show_future_entries = '1'
                page_name        = "<cms:if k_selected_exclude>NOT <cms:show k_selected_exclude /></cms:if>"
                start_on         = my_start_on
                stop_before      = my_stop_before
                base_link        = k_route_link
                token            = k_cur_token
            >

            <cms:if k_paginated_bottom >
                <cms:set my_paginator="<cms:render 'paginator' />" 'parent' />
            </cms:if>

            <tr>
                <cms:render 'list_row' />
            </tr>
...


Sadly, all it does is sending me on the home page of the admin panel when I click the submit button.
Any ideas?

This feature would be really useful to filter articles. I have over 1000 entries, and I have to guess what page the right date would be. Thanks!
Any ideas? Thanks a lot!
Nobody? I think this would be really useful to a bunch of people.
hi,
not sure if this is still an issue but stumbled upon it while trawling for answers of my own.
don't know if this'll help (i am a total novice) but have you done a <cms:dump /> in the <cms:pages> to ensure you are getting my_start_on & my_stop_before passed through.
If the are, are they in the yyyy-mm-dd format?
cheers,
gwil
4 posts Page 1 of 1

Who is online

In total there are 6 users online :: 1 registered, 0 hidden and 5 guests
(based on users active over the past 5 minutes)

Users browsing this forum: Google [Bot] and 5 guests