Jump to:

3460 Posts in 1064 Topics by 739 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Data Object FullTextSearchable limited to certain page types

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

Page: 1
Go to End
Author Topic: 465 Views
  • slimjim002
    Avatar
    Community Member
    2 Posts

    Data Object FullTextSearchable limited to certain page types Link to this post

    Hi,

    Im currently developing a website on a local server for my company and have put in products as DataObjects after following the tutorial of DataObjects as pages part 2 on the SS bits website. This works absolutely fine but I also want to be able to have a product search on the website and realise that searcheable DataObjects is a bit awkward, however after following another tutorial I have also got this working to a degree.

    I can search for products on the live version of the site, but only when im on certain page types i.e home, contact us etc. If I am on a product category or product information page (which are DataObject page types) and enter a search term then I get a page cannot be found message. Im sure it is something simple but im only a beginner in php so any advice would be appreciated.

    Let me know if you want me to supply code.

    Thanks

    James

  • Juanitou
    Avatar
    Community Member
    323 Posts

    Re: Data Object FullTextSearchable limited to certain page types Link to this post

    Hi James.

    Unfortunately I cannot provide you with a solution, but at least I think I know where the problem lies: the Search form is provided by a method of the Page class and its subtypes. Your DataObject-as-Page has not got this method, so it can not generate the form. I don’t know if simply copying the code from the Page class to your DataObject class will suffice, though.

    Hope it helps,
    Juan

  • slimjim002
    Avatar
    Community Member
    2 Posts

    Re: Data Object FullTextSearchable limited to certain page types Link to this post

    Hi Juan,

    I have just tried that and your right, it hasn't made any difference. I will keep looking into it to see if there is another way around.
    Thanks for your help.

    James

    465 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.