Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » issue with big searchform

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 1650 Views
  • blaater
    Avatar
    Community Member
    22 Posts

    issue with big searchform Link to this post

    Hello everybody,

    At the moment I'm having trouble with a big searchform on my website.
    The searchform is located at: http://www.emp-ex.nl/uitgebreid-zoeken

    The problem is that once all the checkboxes are checked silverstripe will generate a url with more then 2083 characters in it and IE will not display the results. I've tried changing the form-method to POST, but when I do this the pagenumbers don't work anymore.

    Is there a way to get the pagenumbers working with the post-method?

    Should I rename all the checkboxes for creating a shorter URL? When I do this I have to rebuild all the queries written for the search.

    Does anybody know a solution for my problem?

    Thanks in advance!

  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: issue with big searchform Link to this post

    POST is the way to go here i guess. which "pagenumbers" are you referring to?

  • blaater
    Avatar
    Community Member
    22 Posts

    Re: issue with big searchform Link to this post

    Hello Ingo,

    The pagenumbers are visible on the resultspage underneath the image container the number of vacancies found, did you try the submit-button at the bottom of the screen? Still have some javascript todo to get the button above the form working

    Thanks!

  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: issue with big searchform Link to this post

    aah, right - didn't click on submit ;)
    the problem is that DataObjectSet->Pages() just appends the "start"-GET-parameter to any existing get-parameter (this is why your search-options are retained on subsequent pages).
    this logic doesn't work with POST-data (or as you noted, URLs longer than ~2000 chars).
    there is no easy way around this - i'd recommend to store all search-parameters in a php-session, and give a unique hash back to the URL.

    in your page-controller's init(), you could check for an existing hash-parameter, and populate the $_POST-array from the session-data belonging to the hash. this is a bit hacky, but easier that to properly customize SearchForm and DataObjectSet

  • blaater
    Avatar
    Community Member
    22 Posts

    Re: issue with big searchform Link to this post

    Hey Ingo,

    Thanks for the support.
    It worked out the way you said!

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