version=pmwiki-2.2.30 ordered=1 urlencoded=1 agent=Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20100101 Firefox/5.0 author=Petko charset=UTF-8 csum=-signature for release host=85.171.160.186 name=PmWiki.CustomWikiStyles rev=50 targets=PmWiki.WikiStyles,PmWiki.WikiAdministrator,Cookbook.Functions,Cookbook.WikiStylesPlus,Cookbook.Callout text=(:Summary: Predefined PmWiki styles & adding custom wiki styles:)%0a(:Audience: administrators (intermediate) :)%0aThis 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).%0a%0aAll predefined [[Wiki Styles]] are setup in the global array $WikiStyle.%0aTo define your own [[Wiki Styles]], add the setting of the correspondent `WikiStyle within the array.%0a%0a[[#predef]]%0a!! Predefined Wiki Styles%0a%0aThe following array-values are set by [@scripts/wikistyles.php@] using the [[Cookbook:Functions#SDV |SDV()-function]] (so you can overwrite them by setting them prior in config.php or farmconfig.php):%0a%0a||width=70%25 border=1 cellpadding=3 cellspacing=0%0a||'''markup:''' ||'''definition:''' ||%0a||[[%3c%3c]]'''text colors:''' [[%3c%3c]] (equiv. to [@%25define=xxxx color=xxxx%25@] ||||%0a|| [@%25black%25@] ||[@$WikiStyle['black']['color'] = 'black';@] ||%0a|| [@%25white%25@] ||[@$WikiStyle['white']['color'] = 'white';@] ||%0a|| [@%25red%25@] ||[@$WikiStyle['red']['color'] = 'red';@] ||%0a|| [@%25yellow%25@] ||[@$WikiStyle['yellow']['color'] = 'yellow';@] ||%0a|| [@%25blue%25@] ||[@$WikiStyle['blue']['color'] = 'blue';@] ||%0a|| [@%25gray%25@] ||[@$WikiStyle['gray']['color'] = 'gray';@] ||%0a|| [@%25silver%25@] ||[@$WikiStyle['silver']['color'] = 'silver';@] ||%0a|| [@%25maroon%25@] ||[@$WikiStyle['maroon']['color'] = 'maroon';@] ||%0a|| [@%25green%25@] ||[@$WikiStyle['green']['color'] = 'green';@] ||%0a|| [@%25navy%25@] ||[@$WikiStyle['navy']['color'] = 'navy';@] ||%0a|| [@%25purple%25@] ||[@$WikiStyle['purple']['color'] = 'purple';@] ||%0a||[[%3c%3c]]'''list-styles:''' ||||%0a|| [@%25decimal%25@] ||[@$WikiStyle['decimal']['apply'] = 'list';@][[%3c%3c]][@$WikiStyle['decimal']['list-style'] = 'decimal';@] ||%0a|| [@%25roman%25@] ||[@$WikiStyle['roman']['apply'] = 'list';@][[%3c%3c]][@$WikiStyle['roman']['list-style'] = 'lower-roman';@] ||%0a|| [@%25ROMAN%25@] ||[@$WikiStyle['ROMAN']['apply'] = 'list';@][[%3c%3c]][@$WikiStyle['ROMAN']['list-style'] = 'upper-roman';@] ||%0a|| [@%25alpha%25@] ||[@$WikiStyle['alpha']['apply'] = 'list';@][[%3c%3c]][@$WikiStyle['alpha']['list-style'] = 'lower-alpha';@] ||%0a|| [@%25ALPHA%25@] ||[@$WikiStyle['ALPHA']['apply'] = 'list';@][[%3c%3c]][@$WikiStyle['ALPHA']['list-style'] = 'upper-alpha';@] ||%0a||[[%3c%3c]]'''special:''' ||||%0a||open links in a new browser-window: ||||%0a|| [@%25newwin%25@] ||[@$WikiStyle['newwin']['target'] = '_blank';@] ||%0a||Turns markup into a comment via display:none CSS ||||%0a|| [@%25comment%25@] ||[@$WikiStyle['comment']['display'] = 'none';@] ||%0a%0a!!Author-Defined Wiki Styles%0a%0a# The first index of the array defines the style name (e.g. mynewstyle, projectentry etc)%0a# the second index defines the attribute name (e.g. color, background-color, etc.)%0a# the value set defines the attribute value (e.g. red, bold, #00ffcc, etc.)%0a%0a'''Sample:''' If you want to define a (site-wide) style the same as the page style%0a->[@%25define=projectentry color:red%25@]%0ause%0a->[@$WikiStyle['projectentry']['color'] = 'red';@]%0a%0a%0aThe [@$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:%0a%0a [@$WikiStyle['top']['apply'] = 'item';@]%0a [@$WikiStyle['top']['class'] = 'top';@]%0a%0athen a markup%0a [@* %25top%25 An important list-item@]%0awill output%0a [@%3cli class="top">An important list-item%3c/li>@]%0a%0a!! Printer-Friendly Styles%0a%0aIf 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.%0a%0a[@if($action!="print") {%0a // your custom-styles%0a}@]%0a%0a!!Notes%0a%0a!!!To be done:%0a%0a!!Questions:%0a'''I tried this but background didn't work, thou border and float worked?''' /Vincent 2008-04-08%0a[@%0a$WikiStyle['vMenu']['background']='#ffffcc' ;%0a$WikiStyle['vMenu']['float']='left' ;%0a$WikiStyle['vMenu']['border']='1px dotted red' ;%0a@]%0a->Try using [@$WikiStyle['vMenu']['background-color']='#ffffcc';@] -- unlike @@background@@, @@background-color@@ is defined in the $WikiStyleCSS array, which is checked for valid properties.%0a%0a----%0a'''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.%0a%0a-> See [[(Cookbook:)WikiStylesPlus]] and [[(Cookbook:)Callout]].%0a time=1315670897