Search result excerpt

On this page:

Syntax

<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.

Attributes

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

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

Examples

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

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

Other tags used: permlink, posted, title.

Genealogy

Version 4.0.6

break attribute added.

See something wrong in this document? Outdated info, a broken link, faulty code example, or whatever? Please write an issue and we’ll fix it.