Wikka : InlineDivFormatting

HomePage :: Categories :: Index :: Changes :: Comments :: Documentation :: Blog :: Login/Register

Custom Div Tags


This is a page from the documentation from my site so if it doesnt follow the guideline here I will change it. I have removed the working examples as this server doesnt have this hack.
The following code needs to go in /Formatters/wikka.php and needs to be in all the else if places towards the top
		// Create custom DIV boxes
		// Syntax = [bgColor][fgColor][width][floating], to close use 
		else if (preg_match("/\<\<....\</s", $thing, $matches)) 
		{
			return('<div style="width:'.((substr($thing, 4, 1) == "0") ? '97%' : substr($thing, 4, 1).'0%').';" class=" rl_default bg_'.substr($thing, 2, 1).' fg_'.substr($thing, 3, 1).' f_'.substr($thing, 5, 1).'">');
		}
		else if (preg_match("/\<d\</s", $thing, $matches)) 
		{
			return ('</div>');
		}
Latter in Formatters/wikka.php this change needs to be made, it needs to be right above the line that is commented as Wiki Markup
	"\<\<....\<|\<d\<|".
These are the additions to css/wikka.css to handle the new classes etc.
/* This is the section added for the customer div RobertLeckie */
.rl_default {
  border:1px solid #EDD
  margin:5px; 
  padding:0 15px 10px 15px; 
}

.f_l {
  float: left;
}
.f_r {
  float: right;
}
.f_n {
  float: none;
}

.bg_r {
  background-color: #FF7C80;
}
.bg_o {
  background-color: #FFCC99;
}
.bg_y {
  background-color: #FFFF99;
}
.bg_g {
  background-color: #CCFFCC;
}
.bg_b {
  background-color: #AAD4FF;
}
.bg_v {
  background-color: #D4AAFF;
}
.bg_k {
  background-color: #000000;
}
.bg_w {
  background-color: #FFFFFF;
}

.fg_r {
  color: #FF7C80;
}
.fg_o {
  color: #FFCC99;
}
.fg_y {
  color: #FFFF99;
}
.fg_g {
  color: #CCFFCC;
}
.fg_b {
  color: #AAD4FF;
}
.fg_v {
  color: #D4AAFF;
}
.fg_k {
  color: #000000;
}
.fg_w {
  color: #FFFFFF;
}
/* This is the end of the custom div section by RobertLeckie */


WantedFormatters
There is one comment on this page. [Display comment]
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki
Page was generated in 0.1083 seconds