mm - enable/disable automatic hit markup

SYNOPSIS

<mm> ... $variables ... </mm>


DESCRIPTION
<mm> and </mm> enable and disable, respectively, automatic hit markup of printed variables, after a query is set with fmtcp (here). This makes it easier to highlight the user's query terms across many result variables when printing a given search result, without having to search-and-replace each variable.


DIAGNOSTICS
<mm> and </mm> have no effect on $ret.

In this example, the user's query is assumed to be in the variable $query, and we are printing one search result from that query, identified by $id. We use <mm> to auto-highlight the user's search terms across several fields (title, subject, description, etc.):


EXAMPLE

<fmtcp query "%mIH" $query>
Your query returned:
<SQL "select Title, Subject, Desc from books where id = $id">
  <mm>
    Title: $Title<BR>
    Subject: $Subject <BR>
    Description: $Desc
  </mm><P>
</SQL>
Other references:
<SQL "select Other, DontMark from sometable where id = $id">
  <mm>$Other</mm> $DontMark
</SQL>

Note that if just a single variable is to be marked up, it may be easier with a single <fmt> call (here):

Your query returned:
<SQL "select Title from books where id = $id">
  Title: <B><fmt "%mIH" $query $Title></B><BR>
</SQL>

without using <fmtcp>, <mm> and </mm>.


CAVEATS
The mm statement was added in version 2.1.896840000 19980603.

Note that only variables are marked up: literal text is not, so that literal HTML formatting tags (e.g. <BR>) are not modified. Debug-syntax variable output ($?myVar etc.) is not marked up (in versions prior to version 7.07.1580929458 20200205, debug-syntax variables could cause errors). Force on/off HTML mode variable output ($+myVar/$-myVar) is marked up, but the +/- variable flag is ignored.


SEE ALSO
fmtcp, fmt strfmt, sb


Copyright © Thunderstone Software     Last updated: Apr 15 2024
Copyright © 2024 Thunderstone Software LLC. All rights reserved.