Skip to content

'Search Enabled' Site Setting

jayrodmcneil edited this page Feb 1, 2018 · 1 revision

When attempting to disable Search Functionality, normally we should just have to set the value of the 'Search/Enabled' Site Setting from false (defaults to true). Doing so does remove the Magnifying Glass from the standard Primary Navigation, however the Search Form on the home page (of the Starter/Custom Portal at least) is still displayed. The 'Search' Web Template is supposed to check this Site Setting and not display the search box unless it is enabled as we see below.

{% assign search_enabled = settings['search/enabled'] | boolean | default:true %}
{% assign search_page = sitemarkers['Search'] %}
{% if search_enabled and search_page %}

Note that the Site Setting being retrieved is lowercase, while the Name of the Site Setting record is 'Search/Enabled' (with uppercase characters). Apparently the setting liquid object is Case Sensitive, so best bet to fix that is to change the case in the Search Web Template to:

{% assign search_enabled = settings['Search/Enabled'] | boolean | default:true %}
{% assign search_page = sitemarkers['Search'] %}
{% if search_enabled and search_page %}

Clone this wiki locally