03.jpg
"Hide From Search" Joomla! Custom Development
Tuesday, 13 January 2009

SM2 created a "hide from search" feature for one of our Joomla! 1.0 managed website. Using the custom SM2 developed code, the site administrators are able to make articles, sections or categories hidden from the default Joomla! site search. This is useful if you have content that is available for internal review and not ready for the public eyes yet.

Joomla! is so much more than just a powerful content management system. The search site is feature available "out of the box." The standard search feature helps navigate users to most popular search items and provide the site administrators with search statistics.

To achieve these features, SM2 made changes to the Joomla! core and to the plugin system as outlined below in "geek speak".

Data processing

hide-from-search-article You need to have somewhere to store the option. In the case of the articles to be hidden from the search, we used a depreciated field in the content table called mask. For the ability to hide a section and category from the search, we added a new field called hide_from_search.

So that this can be processed correctly in the save and apply functions it needs to be added to the appropriate Joomla! table classes. jos_content class already has the mask field but the hide_from_search field needs to be added as a variable to the category and section table classes. No other modification is necessary database because Joomla! will do the rest automatically.

Display

In the edit forms for the articles, sections and categories we added an extra field to the publishing parameter tab. At the end of the tab we simply added a yes or no radio option for the mask or hide_from_search field. This simple update handles the display and the save of the information automatically in the data processing section above.

Search

hide-from-search-category

Finally modification is necessary to the content search plugin (mambot). Extra conditions where added to the queries to  #_content.mask=0 AND #_sections.hide_from_search=0 AND #_categories.hide_from_search=0. The search categories and sections plugins also required similar code.

The outcome

This handy feature assisted the client in hiding content that had to go through a lengthy review process and did not want the sensitive information available for public display until final approval. It also assisted the client as they could send the private url to their stakeholder's to review privately and upon signoff, the menu was published and the sensitive content was marked as not hidden in the search, all with a check of a radio button.

Custom Joomla! Development for You

Are you after custom Joomla! development, SM2 is a team of professional developers and designers keenly focused on providing extensions for the Joomla! user and developer community.

SM2 have been using the Joomla! (and previously Mambo) open source content management frameworks for the last five years.  We continue to provide value back into the community by releasing open source and commercial licences components, modules and plug-ins.  Contact our team of expert Australia based Joomla! developers to assist with your latest development.