Wiki source for TabsMenu

Show raw source


This is what you will get:
{{image url=""}}

By adding this piece of code on your pages:
%%:::[[FirstPage This is the first tab]]::[[SecondPage Second tab]]::@[[ThirdPage Third tab]]::[[LastPage Last tab]]:::%%
It's the character @ after the double or triple colon that marks the tab as active.

..and here is what you need to add to your wikka system:

In wikka.css add:
%%(css)/* Action: tab */
.tabline {
margin: 0px;
padding: 1px;
border-bottom: 1px solid #000;
.activetab {
margin: 0px;
padding: 3px 4px 1px 4px; /* top right bottom left */
border-top: 1px solid #000;
border-left: 1px solid #000;
border-right: 1px solid #000;
.inactivetab {
margin: 0px;
padding: 1px 4px 1px 4px; /* top right bottom left */
border: 1px solid #000;
background-color: #E0E0E0;
You might need to change the background color of your inactive tabs, it depends on what your normal background color is.

In wakka.php add this:
%%(php;390) // TabsMenu
else if (preg_match("/^:::(.*?):::$/s", $thing, $matches))

// Determine if first tab is active or not
$output = $matches[1];
if (substr($output, 0 , 1) == '@') {
$tabclass = 'activetab';
$output = substr($output, 1);
else if ($tab) {
$tabclass = 'inactivetab';

// Fix links or other wiki markup inside tabs
$output = preg_replace_callback(
"\[\[[^\[]*?\]\]|". # forced link
"\b[a-z]+:\/\/\S+|". # URL
"\b[A-ZÅÄÖÜ][A-Za-zÅÄÖÜßåäöü]+[:](?![=_])\S*\b|". # InterWiki link
"\b([A-ZÅÄÖÜ]+[a-zßåäöü]+[A-Z0-9ÅÄÖÜ][A-Za-z0-9ÅÄÖÜßåäöü]*)\b|". # CamelWords
")/ms", "wakka2callback", $output);

$output = str_replace('::@', '</span><span class="activetab">', $output);
$output = str_replace('::', '</span><span class="inactivetab">', $output);

return '<span class="tabline">   </span><span class="' . $tabclass . '">' . $output . '</span><span class="tabline">   </span>';


%%(php;629)$text = preg_replace_callback(
":::.*?:::|". # TabsMenu <== just add this line

What do you think about this? You may include this in the standard code base if you like.



This modification can be made to the [[IncludeAction IncludeAction]] (include.php) so that a tab line like that at the top of this page can be //included// on all the tab pages, making maintenance easier. When adding or deleting tabs, modify the the //included// page with the tabs line vs. having to edit every tab page and set the active tab uniquely on each of these pages.

%%(php;11) // TabsMenu auto detect active tab
if (preg_match("/^:::(.*?):::$/s", $page["body"])) {
print $this->Format( str_replace( '[[' . $this->tag, '@[[' . $this->tag, $page["body"] ) );
else {
print $this->Format($page["body"]);

This is a great enhancement for making good looking and well organized Wiki pages.


Valid XHTML :: Valid CSS: :: Powered by WikkaWiki