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
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:
Additions:
Please note I have removed the highlight text action pending release of
Deletions:
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.
Additions:
SpifFin