Jump to:

1835 Posts in 1139 Topics by 554 members

Blog Module

SilverStripe Forums » Blog Module » Search in blog module by date of post

Discuss the Blog Module.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 293 Views
  • soft dsgn
    Avatar
    Community Member
    1 Post

    Search in blog module by date of post Link to this post

    Hey all,

    I'm wondering if i can use the search function I have setup for my blog to search by the date of the post?

    Currently it is set up to search the text of the blog (and i have a tag filter set up for custom tags) and i'd ilke to be able to search by month and year also. Here's the code presently in page.php

    -------------------------------------------------------------------------

    function SearchForm(){
          $searchText = isset($_REQUEST['Search']) ? $_REQUEST['Search'] : 'Search / ';
        $fields = new FieldSet(
           new TextField("Search", "", $searchText)
        );
          $actions = new FieldSet(
           new FormAction('results', ' ')
        );
          $homePage = DataObject::get_one('HomePage');
          $controller = new Page_Controller($homePage);
          return new Form($controller, "SearchForm", $fields, $actions);

    --------------------------------------------------------------------------

    Would love some help to work this out.
    Cheers..

    293 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.