Go to main content

Search result excerpt



<txp:search_result_excerpt />

The search_result_excerpt tag is a single tag that will show the occurrence of the search term with some surrounding context.


Tag will accept the following attributes (case-sensitive) as well as the global attributes :

HTML tag to be used for search term matches in excerpt text, without brackets.
Default: strong.
Maximum number of search match excerpts per search result.
Default: 5.
separator="tag" v4.7.0+
Trailing string.
Default: (ellipsis).


Example 1: Display up to 15 search excerpts with a search results form

        <txp:title />
    <txp:search_result_excerpt hilight="p" limit="15" /> |
        <txp:permlink />
    | <txp:posted />

Other tags used: permlink, posted, title.


Version 4.7.0

break attribute deprecated in favour of separator.

Version 4.0.6

break attribute added.

If you notice any kind of problem with this page's construction or content (outdated information, typos, broken links, or whatever), open an issue to have it sorted. Or have a go at it yourself. :)