Skip to content

Usage

The plugin in this package highlights the searched terms in the searched request parameter on the fly on the current displayed page. If the request parameter searchtype is filled with exactphrase, only the full request in searched is highlighted.

The highlight result could be templated with a chunk, that could be referenced in the MODX system settings.

System Settings

SearchHighlight uses the following system settings in the namespace searchhighlight.

Key Name Description Default
searchhighlight.debug Debug Log debug information in the MODX error log. No
searchhighlight.disabledTags Disabled Tags Comma-separated list of HTML tags SearchHighlight does not replace text inside. head,form,select
searchhighlight.highlightClasses Search Highlight CSS Classnames CSS classnames that are assigned to the found text on the current page. If multiple classnames are set, the first classname is added to every here highlight
searchhighlight.highlightTpl Highlight Template Template Chunk for the search highlight replacement. tplTermHighlight
searchhighlight.searchedRequestKey Searched Parameter Key Request parameter key that contains the searched terms. searched
searchhighlight.searchTerms Search Terms Marker Marker that is replaced with the search terms. <!--search_terms-->
searchhighlight.searchTermsTpl Search Terms Template Template Chunk for the search terms. tplSearchTerms
searchhighlight.searchtypeRequestKey Searchtype Request Key Request parameter key that contains the searchtype. searchtype
searchhighlight.sections Restrict to Sections Replace SearchHighlight links only in sections marked with &lt;!— SearchHighlightStart --&gt; and &lt;!— SearchHighlightEnd --&gt;. The section markers could be changed with the settings searchhighlight.sectionsStart and searchhighlight.sectionsEnd. No
searchhighlight.sectionsEnd Section End Marker Marker at the end of a section processed by SearchHighlight. The restriction to marked sections can be activated in the setting searchhighlight.sections. <!-- SearchHighlightEnd -->
searchhighlight.sectionsStart Section Start Marker Marker at the start of a section processed by SearchHighlight. The restriction to marked sections can be activated in the setting searchhighlight.sections. <!-- SearchHighlightStart -->