PmWiki »

Custom Wiki Styles

PmWiki.CustomWikiStyles History

Hide minor edits - Show changes to output

May 14, 2017 by Sticky - YujYM01fkRW
Changed line 1 from:
Oi, Cris!! Que legal seu trabalho!! Parabéns!!!Qdo será o dia que vamos sentar p fofocar um pouco e tirar muuuitas fotos “nessa Petrópolis linda”????!!!!rs… Saudade dessa brisa seCosna!……Bjinhra!!!…rintia.
You really saved my skin with this <a href="">inrnimatfoo.</a> Thanks!
May 14, 2017 by Emberlynn - CIV3xUzjDf
Changed lines 1-108 from:
(:Summary: Predefined PmWiki styles & adding custom wiki styles:)
(:Audience: administrators (intermediate) :)
This page describes the predefined [[Wiki Styles]] and how a [[Wiki Administrator]] can define additional [[Wiki Styles]] as a local customization for all pages (in local/config.php) or specific groups (in local/$Group.php).

All predefined [[Wiki Styles]] are setup in the global array $WikiStyle.
To define your own [[Wiki Styles]], add the setting of the correspondent `WikiStyle within the array.

!! Predefined Wiki Styles

The following array-values are set by [@scripts/[email protected]] using the [[Cookbook:Functions#SDV |SDV()-function]] (so you can overwrite them by setting them prior in config.php or farmconfig.php):

||!markup: ||!definition: ||
||[[<<]]'''text colors:''' ||[-(equivalent to [@%define=xxxx color=xxxx%@])-] ||
|| [@[email protected]]  ||[@$WikiStyle['black']['color'] = 'black';@] ||
|| [@[email protected]]  ||[@$WikiStyle['white']['color'] = 'white';@] ||
|| [@[email protected]]    ||[@$WikiStyle['red']['color'] = 'red';@] ||
|| [@[email protected]] ||[@$WikiStyle['yellow']['color'] = 'yellow';@] ||
|| [@[email protected]]  ||[@$WikiStyle['blue']['color'] = 'blue';@] ||
|| [@[email protected]]  ||[@$WikiStyle['gray']['color'] = 'gray';@] ||
|| [@[email protected]] ||[@$WikiStyle['silver']['color'] = 'silver';@] ||
|| [@[email protected]] ||[@$WikiStyle['maroon']['color'] = 'maroon';@] ||
|| [@[email protected]]  ||[@$WikiStyle['green']['color'] = 'green';@] ||
|| [@[email protected]]  ||[@$WikiStyle['navy']['color'] = 'navy';@] ||
|| [@[email protected]] ||[@$WikiStyle['purple']['color'] = 'purple';@] ||
||[[<<]]'''list-styles:''' ||||
|| [@[email protected]] ||[@$WikiStyle['decimal']['apply'] = 'list';@][[<<]][@$WikiStyle['decimal']['list-style'] = 'decimal';@] ||
|| [@[email protected]] ||[@$WikiStyle['roman']['apply'] = 'list';@][[<<]][@$WikiStyle['roman']['list-style'] = 'lower-roman';@] ||
|| [@[email protected]] ||[@$WikiStyle['ROMAN']['apply'] = 'list';@][[<<]][@$WikiStyle['ROMAN']['list-style'] = 'upper-roman';@] ||
|| [@[email protected]] ||[@$WikiStyle['alpha']['apply'] = 'list';@][[<<]][@$WikiStyle['alpha']['list-style'] = 'lower-alpha';@] ||
|| [@[email protected]] ||[@$WikiStyle['ALPHA']['apply'] = 'list';@][[<<]][@$WikiStyle['ALPHA']['list-style'] = 'upper-alpha';@] ||
||[[<<]]'''special:''' ||||
||open links in a new browser-window: ||||
|| [@[email protected]] ||[@$WikiStyle['newwin']['target'] = '_blank';@] ||
||Turns markup into a comment via display:none CSS ||||
|| [@[email protected]] ||[@$WikiStyle['comment']['display'] = 'none';@] ||
||[[<<]]'''wiki styles''' ||||
|| [@[email protected]] ||border:1px solid #cccccc; padding:4px; background-color:#f9f9f9; ||
|| [@[email protected]] ||float:left; margin-right:0.5em; ||
|| [@[email protected]] ||float:right; margin-left:0.5em; ||
|| [@[email protected]] ||
|| [@[email protected]] ||frame lfloat||
|| [@[email protected]] ||frame rfloat||
|| [@[email protected]] ||
|| [@[email protected]] ||block white-space:pre ||
|| [@[email protected]] ||block class:sidehead ||

!!Author-Defined Wiki Styles

# The first index of the array defines the style name (e.g. mynewstyle, projectentry etc)
# the second index defines the attribute name (e.g. color, background-color, etc.)
# the value set defines the attribute value (e.g. red, bold, #00ffcc, etc.)

'''Sample:''' If you want to define a (site-wide) style the same as the page style
->[@%define=projectentry color:red%@]
->[@$WikiStyle['projectentry']['color'] = 'red';@]

The [@$WikiStyle['projectentry']['apply']@] variable may be defined if the wikistyle concerns a particular tag. It may be @@'item' (for li|dt), 'list' (for ul|ol|dl), 'div', 'pre', 'img', 'p'@@ or the combining @@'block' (for p|div|ul|ol|dl|li|dt|pre|h[1-6])@@. Example:

 [@$WikiStyle['top']['apply'] = 'item';@]
 [@$WikiStyle['top']['class'] = 'top';@]

then a markup
 [@* %top% An important [email protected]]
will output
 [@<li class="top">An important list-item</li>@]

!! Printer-Friendly Styles

If your custom-styles (in local/config.php) are getting very colorful it might be useful to disable them in print-view. This can be done easily by putting them into a condition.

[@if($action!="print") {
  // your custom-styles


!!!To be done:

'''I tried this but background didn't work, thou border and float worked?''' /Vincent 2008-04-08
$WikiStyle['vMenu']['background']='#ffffcc' ;
$WikiStyle['vMenu']['float']='left' ;
$WikiStyle['vMenu']['border']='1px dotted red' ;
->Try using [@$WikiStyle['vMenu']['background-color']='#ffffcc';@] -- unlike @@[email protected]@, @@[email protected]@ is defined in the $WikiStyleCSS array, which is checked for valid properties.

'''Q:''' How would I set an image to the left of a paragraph in a WikiStyle? I'd like to provide an icon for paragraphs that are notes, important, warnings, etc.

-> See [[(Cookbook:)WikiStylesPlus]] and [[(Cookbook:)Callout]].

>>faq<< [[#faq]]
Q:How can I remove underlining from a link, but make it underlined blue when the mouse hovers?

A:Put in pub/css/local.css:
 .noul a {text-decoration: none;}
 .noul a:hover {text-decoration: underline; color: blue;}

Then use this markup:
  [@%noul% [[Link]] %%@]
Oi, Cris!! Que legal seu trabalho!! Parabéns!!!Qdo será o dia que vamos sentar p fofocar um pouco e tirar muuuitas fotos &#8220;nessa Petrópolis linda&#8221;????!!!!rs&#8230; Saudade dessa brisa seCosna!&#8230;&#8230;Bjinhra!!!&#8230;rintia.
Page last modified on May 14, 2017

Edit - History - Print - Recent Changes (All) - Search