+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Search result paging not loading custom widgets

Search result paging not loading custom widgets

4 posts, 0 answered
  1. AJ
    AJ avatar
    3 posts
    Registered:
    13 Sep 2013
    13 Sep 2013
    Link to this post
    I have a custom template on which I have placed a custom widget for a search input field and button (plus another custom widget for menu).
    The search widget sends the search text to the search results page which is a custom templated page having a search result widget on it, this is the standard search result widget. The custom template again has my two custom widgets for menu and search in the header area.

    This works fine for the initial display of search results when the url is 
    http://localhost:60876/searchresult?page=2&indexCatalogue=new-search-index&searchQuery=teachers&wordsMode=1

    The search results widget has paging enabled so the footer shows the paging numbers and links.

    A link to the second page is like this:
    http://localhost:60876/searchresult/page/2?page=2&indexCatalogue=new-search-index&searchQuery=teachers&wordsMode=1

    When this second page displays (with correct contents) my custom widgets do not display. The divs for them are blank.

    It seems to be related to the route used where there are extra parameters  (searchresult/page/2 ).

    The Search result page otherwise is loading the styles and footer content blocks correctly, just not my custom widgets.

    Is there something I can look at to fix this? 
    Suggestions welcomed.
  2. Kaloyan
    Kaloyan avatar
    272 posts
    Registered:
    02 Dec 2016
    17 Sep 2013
    Link to this post
    Hi AJ,

    Because your scenario is a bit complex I would suggest to share some screenshots or better record a video to demonstrate the exact problem. If you have a live site you can submit a support ticket where you can provide us with backend credentials and we will inspect the problem in details. 

    Regards,
    Kaloyan
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. AJ
    AJ avatar
    3 posts
    Registered:
    13 Sep 2013
    18 Sep 2013
    Link to this post
    Thanks, I have submitted a support ticket.

    The problem has been dealt with for the moment by means of copying the custom widget code into the master page itself. This is undesirable as it means there is duplicate code in the site but at least the site operates as intended.
    As I am new to SF I think I just need to understand the page lifecycle as SF uses it.
  4. AJ
    AJ avatar
    3 posts
    Registered:
    13 Sep 2013
    20 Sep 2013 in reply to AJ
    Link to this post
    Further information has been offered by TelerikSupport:
    When the page changes the url is also changed. Edit the search results widget and go to Advanced-UrlKeyPrefix and enter the prefix "search", for the other widgets on the page also go to edit them and select Advanced ->UrlKeyPrefix and set the same string "search", now all widgets will share the same url.

    My reply:
    Ok I had a try at that but unfortunately my SF version must be different to yours so I am seeing different properties. I am using SF 6.1.4600 here on all versions of my site. When editing the page template which contains my custom widgets, the properties dialog does not contain the properties you mention as there are only three (AsyncManager, Profile and ViewEndingCollection). I presume these are the default for a custom MVC widget.

    When I edit the SearchResult page which has the standard SearchResult widget on it, and open the properties of the widget, there is no property named UrlKeyPrefix. There are ones called PageKey and UrlEvaluationMode but I dont know if these are what you meant.

    TelerikSupport came back with:
     I am sorry for missing this, the UrlKeyPrefix is not available as property for the MVC widgets to be added they need to add an attribute to each ActionResult as explained in this blog post, however the search results widget will not match the added attribute because Search results when rendering the links to search results pages doesn`t have an out of the box way to set UrlKeyPrefix. 
    Custom MVC widgets disappear when the paging have been changed because they are dependant on the page route and when the route changes to display a page the widget action is not executed.

    I will research and find a way to render the MVC widgets when the search have paging by either making a modification to search results widget or adding specific case of handling the route in MVC widgets. I am sorry for the delay.

4 posts, 0 answered