color for highlighting

Post Reply
astrid.grossboetzl
Posts: 40
Joined: Tue Jan 15, 2002 9:54 am

color for highlighting

Post by astrid.grossboetzl »

hi,
is it possible to give the highlighted query a color like red? i only found the m-flag in the fmt-function and there is no possibility.
best regards
Astrid
User avatar
Kai
Site Admin
Posts: 1272
Joined: Tue Apr 25, 2000 1:27 pm

color for highlighting

Post by Kai »

There's no option to do this directly, but if there are no tags you wish preserved already in your text, you can use "%mbH" and <sandr> the resulting <B> and </B> tags into red:

<strfmt "%mbH" $query $txt>
<$s = "<B>" "</B>">
<$r = "<FONT COLOR=red>" "</FONT>">
<sandr $s $r $ret>
<send $ret>
astrid.grossboetzl
Posts: 40
Joined: Tue Jan 15, 2002 9:54 am

color for highlighting

Post by astrid.grossboetzl »

I write the following into the script:
<fmtcp query "%mbH" $mmfmt><!-- setup hit markup -->
<$s = "<B>" "</B>">
<$r = "<FONT COLOR=red>" "</FONT>">
<sandr $s $r $ret>
<send $ret>

But it doesn´t work. Maybe I wrote this into the wrong section. Can yout tell me the section?
thanks
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

color for highlighting

Post by mark »

Put it where the data you want hilighted is output. But you've replaced <strfmt> with <fmtcp>. That is incorrect. Follow the example kai gave.
astrid.grossboetzl
Posts: 40
Joined: Tue Jan 15, 2002 9:54 am

color for highlighting

Post by astrid.grossboetzl »

Can you tell me what the argument $txt means?
I can´t find it in my documentation.
<strfmt "%mbH" $query $txt>
<$exp = "<B>" "</B>">
<$replace = "<i>" "</i>">
<sandr $exp $replace $ret>
<send $ret>
Thanks
User avatar
Kai
Site Admin
Posts: 1272
Joined: Tue Apr 25, 2000 1:27 pm

color for highlighting

Post by Kai »

$txt is the variable that contains the text to be marked up. It could be any variable, depends on the script context.
astrid.grossboetzl
Posts: 40
Joined: Tue Jan 15, 2002 9:54 am

color for highlighting

Post by astrid.grossboetzl »

hi,
when i take your code it doesn´t work. In the source code of the webpage i get the error:
<!-- 015 /webinator/search-cms:530: Can't turn on markup: No query set with <fmtcp> -->
can you tell me whats wrong in my code?
thanks
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

color for highlighting

Post by mark »

Sounds like you're using <mm> somewhere but haven't called <fmtcp> to setup a query. If you're using the <strfmt> method you probably shouldn't be using <mm>.
Post Reply