contextual search how can I configure this button?

andy_dufresne
Tera Expert

Hello,

I have a contextual search, when a user searches it gives a list of "record producers".   The user wants to simple click on the link and it should take him to the required 'record producer'.

So I want to get rid of this button "Take Me To Form" [which does the right job, but want the url link before it to do the job]

find_real_file.png

I have searched everywhere in the contextual search and record producers, but cannot locate this "Take Me To Form" button.

1 ACCEPTED SOLUTION

Hi Andy.



You can get rid of the button with a catalog client script. Please be aware though, when you upgrade, there may be changes to Contextual Search could break your script. You'll be able to see if we've changed anything in contextual search in the release notes though.



This is the script:


function onLoad() {


      document.observe("cxs:target_update", function() {


              $$("#cxs_results_container button.request_catalog_button_with_icon").each(function(elem, index) {


                      elem.hide();


              });


      });


}



The event cxs:target_update is fired each time a search is completed.



This is what my catalog client script looks like:


find_real_file.png



This will only work on your record producer. If you wanted to do hide the Order button when displaying contextual search results on a form you would need to create an onLoad client script there too. The however should be the same.



Let me know if this works for you.



Thanks,



Cameron


View solution in original post

16 REPLIES 16

Thanks Cameron!



Lets talk UI/UX: Contextual Search + Catalog + Incident



This article suggests that a "button" can be created in contextual search, I still can't figure out where this button could be [if it is not in] "System UI --> UI Actions" I further checked all the UI actions btw.



find_real_file.png


Hi Andy,



There isn't a way through configuration to achieve what you want to do, the button is always going to be present.



The larger underlying issue is that Contextual Search is locked down. It won't always be that way but it currently is. This includes the UI Pages, UI Macros and the ability to create your own search resources.



You could work around it but would need to write a script to change the behavior. The problem with doing this though is if we change the macro enough, your script could stop working. That said, what exactly do you want to do?



Thanks,



Cameron


andy_dufresne
Tera Expert

Hi Cameron,



I'm trying the default behaviour what that 'order' button is supposed to do.   However my end-users are confused the significance of the link AND the button.   they requested if we can get rid of the button and simple have the link [like google].



If not button do you reckon we can get rid of the hyperlink?



Thanks for taking pain to reply me!


Hi Andy.



You can get rid of the button with a catalog client script. Please be aware though, when you upgrade, there may be changes to Contextual Search could break your script. You'll be able to see if we've changed anything in contextual search in the release notes though.



This is the script:


function onLoad() {


      document.observe("cxs:target_update", function() {


              $$("#cxs_results_container button.request_catalog_button_with_icon").each(function(elem, index) {


                      elem.hide();


              });


      });


}



The event cxs:target_update is fired each time a search is completed.



This is what my catalog client script looks like:


find_real_file.png



This will only work on your record producer. If you wanted to do hide the Order button when displaying contextual search results on a form you would need to create an onLoad client script there too. The however should be the same.



Let me know if this works for you.



Thanks,



Cameron


Hi Cameron,



Firstly BIG THANKS for taking time out on a weekend to solve my issue!



The script you gave works like a charm -Thanks again!



The button is gone now [which is great], it would be nicer if the URL itself took directly to the place which the 'order' button would have taken.



I will research further if that is possible, if you know this at your finger tips, I would appreciate.   But I'm happy to do some homework to dig this myself too!



Kind Regards!