Hello,
Is there a way to search posts by date range?
I tried using the following code:
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:
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!
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!