How do I remove the "intelligent search" box?

Permalink 1 user found helpful
Hi, how do I remove the "intelligent search" box?
"White labelling" options don't seem to do the trick.
I think there is an option missing for "ENABLE_INTELLIGENT_SEARCH" (completely removing the search box from the interface in edit mode).

View Replies: View Best Answer
mesuva replied on at Permalink Best Answer Reply
mesuva
I think this may be because it would be considered a rare case that someone would want to remove the intelligent search - it's pretty useful.

There are white labeling options to remove concrete5 specific results from the intelligent search:http://www.concrete5.org/documentation/how-tos/developers/white-lab...
So you can customise it to only be specific to your setup.

Perhaps no option to disable it has been created because it's pretty easy to hide the search with a little bit of CSS. So if you really want to hide it, you could use:

#ccm-nav-intelligent-search-wrapper {
display: none;
}


You could even add this CSS via Themes->Customise (for your current theme) and then the 'Add Your CSS' option. If you have created your own theme, you'd just add this to your custom stylesheet.

I personally don't recommend this though, I'd hate to start supporting a concrete5 website and find that the previous developer had turned off 'standard' features of the interface.
kesnav replied on at Permalink Reply
Thank you for replying. Actually, I just want to remove that box from the edit mode, not from the dashboard, since I want my clients to be able only to do basic content edition on the pages. They don't have access to the dashboard and I don't find it useful for them to have that search box. Moreover, they don't understand English and currently the c5 translation that I need is incomplete and with an awful quality. So, that search box adds uneeded support for me to answer their questions related to it.

Your solution has two drawbacks:

1. It hides the search box from both the edit mode and the dashboard. And of course I'd like it in the dashboard.

2. It is not really removed, just hidden, and users could make it appear just by editing the CSS property in any modern browser like Firefox (right click > inspect). I know this one is a extreme case but it's possible. I don't want to hide it with CSS, I'd like to remove it 'for real'.

So..... any ideas on how to remove the search box from the edit mode?

Thank you.
mesuva replied on at Permalink Reply
mesuva
I'm pretty sure my suggestion only removes it when you are viewing/editing pages, not when you are in the dashboard. That's what happened when I tried it out myself.

I don't think your second point is a realistic concern. :-)
kesnav replied on at Permalink Reply
Ok thanks :) I will mark your answer as best answer.

You're right. The CSS applies only to the site itself and not to the dashboard, so that's indeed a possible solution.

I found the file responsible to generate the search box though. So for those who want to 'completely' remove the search box you should override (c5 override style) the file:

/concrete/tools/page_controls_menu_js.php

Remove:

menuHTML += '<li id="ccm-nav-intelligent-search-wrapper"><input type="search" placeholder="<?php echo t('Intelligent Search')?>" id="ccm-nav-intelligent-search" tabindex="1" /></li>';


That would remove it from edit mode. And to the curious, the file you should look to remove it from the dashboard is:

/concrete/themes/dashboard/elements/header.php

Remove:
<li id="ccm-nav-intelligent-search-wrapper"><input type="search" placeholder="<?php echo t('Intelligent Search')?>" id="ccm-nav-intelligent-search" tabindex="1" /></li>


Regards.

PS: Not looking good that code duplication in the core. I wonder what happened with the "reuse" approach.