Revision history for HighlightAction


Revision [18838]

Last edited on 2008-01-28 00:13:00 by SpifFin [Modified links pointing to docs server]

No Differences

Revision [13943]

Edited on 2006-04-26 06:34:11 by SpifFin [Modified links pointing to docs server]
Additions:
Please note I have removed the highlight text action pending release of Wikka 1.1.6.2, when the feature will be implemented fully.
Deletions:
Please note I have removed the highlight text action pending release of


Revision [13942]

Edited on 2006-04-26 06:33:21 by SpifFin [Modified links pointing to docs server]
Additions:
Please note I have removed the highlight text action pending release of
Deletions:
This is an embarrassingly simple action to allow ""<span style="background-color: yellow">highlighted text</span>"" in a colour of your choice. It is a simple hack of the color action.
There are two versions: one which allows for a pre-defined highlight colour to be used each time, and another which allows for any colour to be entered and displayed.
===Version one - single pre-defined highlight colour===
Simply copy this code, change the word 'yellow' to any css named colour (e.g. yellow) or hex colour (e.g. #FFFF00), save as highlight.php and upload to the actions directory:
%%
<?php
if (is_array($vars)) {
foreach ($vars as $param => $value) {
if ($param == 'text')
{
$mytext= $value;
}
}
echo "<span style=\"background-color: yellow\">".$mytext."</span>";
}
?>
%%
To use, simply call the action and define your text, for example:
%%
{{highlight text="my highlighted text"}}
%%
===Version two - define the highlight colour each time===
Simply copy this code, save as highlight.php and upload to the actions directory:
%%
<?php
if (is_array($vars)) {
foreach ($vars as $param => $value) {
if ($param == 'text')
{
$mytext= $value;
}
if ($param == 'c')
{
$colorcode=$value;
}
elseif ($param == 'hex')
{
$colorcode=$value;
}
}
echo "<span style=\"background-color: $colorcode\">".$mytext."</span>";
}
?>
%%
To use, simply call the action, define your colour (as a css named colour, e.g. yellow, or in hex, e.g. #FFF00) and define your text, for example:
%%
{{highlight c="yellow" text="my highlighted text"}}
%%
or:
%%
{{highlight hex="#FFFF00" text="my highlighted text"}}
%%
Hope someone finds this useful.


Revision [13925]

Edited on 2006-04-25 13:47:13 by SpifFin [Modified links pointing to docs server]
Additions:
SpifFin


Revision [13922]

The oldest known version of this page was created on 2006-04-25 13:41:00 by SpifFin [Modified links pointing to docs server]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki