Customer Portal

Get Involved. Join the Conversation.

Topic

    EAKBTeam
    Advanced SearchAnswered
    Topic posted February 10, 2009 by EAKBTeam Red Ribbon: 250+ Points, last edited October 29, 2011 
    1897 Views, 13 Comments
    Title:
    Advanced Search
    Content:

    Hi All,

     

    Please forgive my beginners knowledge here, but I am trying to figure out how too keep the Advanced search details open after performing a search (or reset to All).

    Currently if you perform an advanced search you are presented with the results, however the advanced search details are hidden, but the values are still held.

    I believe that this will cause issues for our users forgetting that they have set these.

     

    Does anyone have any suggestions?

     

    Thanks,

     

    Guy

    Best Comment

    Ernie Turner

    I took a look at this and I think I understand your problem, because it looks like we have a bug related to this. I poked around at it a bit and I can see that there isn't a very clean way to automatically have the advanced search section display whenever advanced search paramters are in the URL. I will write up a bug on this and we'll get it fixed.

     

    In the meantime, I think you can customize the AnswerSearchArea widget to open or close if any advanced URL parameters are present.

     

    This is the current code in the view file

     

    <?if(getUrlParm('srchopen')):?> <div id="advsearch" name="advsearch" style="display:block;"> <?else:?> <div id="advsearch" name="advsearch" style="display:none;"> <?endif;?>

     Which could be changed to something like this

     

     

    <?if(getUrlParm('srchopen') || getUrlParm('p') || getUrlParm('c')):?> <div id="advsearch" name="advsearch" style="display:block;"> <?else:?> <div id="advsearch" name="advsearch" style="display:none;"> <?endif;?>

     

     

     

     

     

    Comment

     

    • Ernie Turner
      The advanced search area will respond to a url parameter, 'srchopen'. So if you use the following URL, '/app/answers/list/srchopen/1', the advanced search content will automatically be expanded on page load.
    • EAKBTeam

      Thanks for your help, just wondering where this code is actually supposed to be entered?

      It needs to be the default URL for the list page, as well as carrying over the Advanced search on to the details page.

      Thanks Again,

      Guy

       

    • chris fellows

      If you want the Advanced Search to be open whenever someone goes to the answers/list page,  you can make a change to the template that you're using (rn_standard.php would be the default).  In there you could make the following change to the NavigationTab widget for the Answers link. 

       

       

      <li> <rn:widget path="standard/navigation/NavigationTab" label="#rn:msg:ANSWERS_HDG#" link="/app/answers/list/srchopen/1" pages="answers/list, answers/detail" css_class="selected" /> </li>

       

      If you are linking from an external site directly to the Answers List page then you can format the url like so:

       

      http://<sitename>/app/answers/list/srchopen/1

       

       

    • Ernie Turner

      I took a look at this and I think I understand your problem, because it looks like we have a bug related to this. I poked around at it a bit and I can see that there isn't a very clean way to automatically have the advanced search section display whenever advanced search paramters are in the URL. I will write up a bug on this and we'll get it fixed.

       

      In the meantime, I think you can customize the AnswerSearchArea widget to open or close if any advanced URL parameters are present.

       

      This is the current code in the view file

       

      <?if(getUrlParm('srchopen')):?> <div id="advsearch" name="advsearch" style="display:block;"> <?else:?> <div id="advsearch" name="advsearch" style="display:none;"> <?endif;?>

       Which could be changed to something like this

       

       

      <?if(getUrlParm('srchopen') || getUrlParm('p') || getUrlParm('c')):?> <div id="advsearch" name="advsearch" style="display:block;"> <?else:?> <div id="advsearch" name="advsearch" style="display:none;"> <?endif;?>

       

       

       

       

       

    • EAKBTeam

      Fantastic, thanks so much for your help. I thought that it may have been a bug of some sort.

       

      Only questions now is... Is there anyway to keep the advanced search open once on the details page??? It seems to be holding the Advanced search criteria, but hides the box again once you are in Details.

      I have entered the suggested code on the AnswerSearchArea and appears to work ok for the list page, however when I put the same code into the AnswerSearchArea2 it does not have the same effect..Is there something that I am missing here?

       

      Thanks again for your assistance, this forum has been a world of help for a newbie like me to find information to help us build our CP.

       

    • Ernie Turner

      I've attached the view file that I used and that appears to be working. Give it a shot and let me know if its not working for you. There are two places in the view where you need to check for URL paramters, one to hide/show the content, and another to display the correct 'Advanced' or 'Basic' label.

       

      Also, you'll notice that in that code I'm performing an intval() on the return of the getUrlParm() function. Thats just to ensure that the value in the URL is actually set to a prod/cat id and isn't just blank.

    • EAKBTeam

      Hey Ernie,

       

      Thanks for putting together that code, and so quickly, however it still does not appear to be working.

       

      The advanced search criteria box is still not displaying on the details page... The criteria is still contained in the fields, however the box is still hidden...??

       

      It is not a major issue, it would just make using the site a little easier for our users..

       

    • Ernie Turner
      What is the URL you are using on that page when it doesn't work? It seems kind of bizarre that if you have the same code on your list and detail page that it would behave differently.
    • EAKBTeam

      I agree, it is a little strange, it has to be something im missing...

      The URL that is appearing when viewing this page is: https://employment-systems--upgrade.custhelp.com/app/answers/detail/a_id/1605/p/66/c/71/r_id/104787 - If you expand the Advanced search all of the products and catagories set on the /list page still appear.

      I have attached the code for our /detail, /list and both /AnswerSearch files.

      Thanks Ernie.

       

       

       

    • Ernie Turner

      In the detail.php page that you attached, it doesn't look like you are referencing your customized widget, so I'm guessing that is the problem.

       

       

      <div class="rn_mastheadintro"> <p>#rn:msg:FIND_ANS_MSG#</p>

       

      <rn:widget path="standard/composite/AnswerSearchArea2" report_id="104787"/>

       

      </div> <!-- class="rn_mastheadintro" -->

       

       

    • EAKBTeam

      Hey Ernie, You have lost me here.

       

      I have not created a custom widget, All i have done is change the code in the existing AnswerSearchArea2 to reflect your suggestions from last week.

      From what I can see the detail page has the correct reference to the AnswerSearchArea2 widget..?

      Cheers,

      Guy

    • Ernie Turner
      I'm not sure how you changed the existing AnswerSearchArea2 widget because that is a standard widget and you aren't allowed to modify it (trying to upload the changes to WebDAV should give you an error). To change the content of a standard widget, you have to copy it and create a custom widget.
    • EAKBTeam
      Got there in the end! Thanks again Ernie.. I have no idea what I was thinking.. Work perfectly!