Skip to main content
Inspiring
August 24, 2016
解決済み

Set search results to all search words as default in responsive help

  • August 24, 2016
  • 返信数 2.
  • 1689 ビュー

Hi - Can anyone help me on this please? Originally posted 24th August but no replies.

Thanks

Hi,

I am using responsive HTML5 help in Robohelp 2015. There is an option for users to tick a box for all search words for an AND search otherwise the default is OR.

Can this be set as default - so that the box is automatically ticked for an AND search?

There isn't an option for this so I guess it will require a code change but I haven't manage to locate the code yet.

Thanks

* I see the same question has been asked for Robohelp 11 but the solution given doesn't seem to work for Robohelp 2015.

http://forums.adobe.com/message/7733536#7733536

このトピックへの返信は締め切られました。
解決に役立った回答 Willam van Weelden

I'm not sure if it has to do with Update 4, but you never know...

I mean exactly what your image shown: checking AND search by default.

For the output, please contact me at: contact [at] wvanweelden [dot] eu.


I looked into the output and it seems that setting the value doesn't always correctly change the checkbox value. But there is a 'workaround'. By mimicking a user interaction, you can set the AND search when the page is loaded.

In the layouts usersettings.js file, go to line 35, with the text rh.model.publish(xxxx

Add a new line below that and add the code:

setTimeout(function(){

  var rh = window.rh;

  var isAND = rh.model.get(rh.consts('KEY_AND_SEARCH'));

  if(isAND != 1) {

  var checkbox = document.getElementById('andsearch');

  checkbox.click();

  }

  }, 1000);

返信数 2

Captiv8r
Legend
October 26, 2016

Have you looked at the customization options? From the SSL recipe, click Customize Selected Layout.

Then click the Search (All) and you see settings that allow you to change behavior.

Cheers... Rick

gc31作成者
Inspiring
October 26, 2016

hi,

Yes thanks i've looked at that. That just turns off the option to select the AND search just leaving OR as the default, I believe?

Captiv8r
Legend
October 28, 2016

Hi Willam,

I tried the above on a new test project but it doesn't seem to work for me.

The AND search isn't enabled as default. Here's the code added:

Thanks.


Hi there

Not sure if it will make a difference, but you have a space before your 1. Did you try removing that?

Cheers... Rick

Jeff_Coatsworth
Community Expert
Community Expert
October 25, 2016

Are there no topic.slp files in RH2015's \!Screenlayout!\ folder?

gc31作成者
Inspiring
October 26, 2016

Yes this seems to be the file to change but cannot quite get it to work correctly.

Jeff_Coatsworth
Community Expert
Community Expert
October 26, 2016

Is the change to that file's coding having any effect on the output?