version=pmwiki-2.2.63 ordered=1 urlencoded=1
author=mfwolff
charset=UTF-8
csum=[[#faqend]]
name=PmWiki.CustomWikiStyles
rev=54
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||class='tabtable'%0a||!markup: ||!definition: ||%0a||[[%3c%3c]]'''text colors:''' ||[-(equivalent to [@%25define=xxxx color=xxxx%25@])-] ||%0a|| [@black@]  ||[@$WikiStyle['black']['color'] = 'black';@] ||%0a|| [@white@]  ||[@$WikiStyle['white']['color'] = 'white';@] ||%0a|| [@red@]    ||[@$WikiStyle['red']['color'] = 'red';@] ||%0a|| [@yellow@] ||[@$WikiStyle['yellow']['color'] = 'yellow';@] ||%0a|| [@blue@]   ||[@$WikiStyle['blue']['color'] = 'blue';@] ||%0a|| [@gray@]   ||[@$WikiStyle['gray']['color'] = 'gray';@] ||%0a|| [@silver@] ||[@$WikiStyle['silver']['color'] = 'silver';@] ||%0a|| [@maroon@] ||[@$WikiStyle['maroon']['color'] = 'maroon';@] ||%0a|| [@green@]  ||[@$WikiStyle['green']['color'] = 'green';@] ||%0a|| [@navy@]   ||[@$WikiStyle['navy']['color'] = 'navy';@] ||%0a|| [@purple@] ||[@$WikiStyle['purple']['color'] = 'purple';@] ||%0a||[[%3c%3c]]'''list-styles:''' ||||%0a|| [@decimal@] ||[@$WikiStyle['decimal']['apply'] = 'list';@][[%3c%3c]][@$WikiStyle['decimal']['list-style'] = 'decimal';@] ||%0a|| [@roman@] ||[@$WikiStyle['roman']['apply'] = 'list';@][[%3c%3c]][@$WikiStyle['roman']['list-style'] = 'lower-roman';@] ||%0a|| [@ROMAN@] ||[@$WikiStyle['ROMAN']['apply'] = 'list';@][[%3c%3c]][@$WikiStyle['ROMAN']['list-style'] = 'upper-roman';@] ||%0a|| [@alpha@] ||[@$WikiStyle['alpha']['apply'] = 'list';@][[%3c%3c]][@$WikiStyle['alpha']['list-style'] = 'lower-alpha';@] ||%0a|| [@ALPHA@] ||[@$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|| [@newwin@] ||[@$WikiStyle['newwin']['target'] = '_blank';@] ||%0a||Turns markup into a comment via display:none CSS ||||%0a|| [@comment@] ||[@$WikiStyle['comment']['display'] = 'none';@] ||%0a||[[%3c%3c]]'''wiki styles''' ||||%0a|| [@frame@] ||border:1px solid #cccccc; padding:4px; background-color:#f9f9f9; ||%0a|| [@lfloat@] ||float:left; margin-right:0.5em; ||%0a|| [@rfloat@] ||float:right; margin-left:0.5em; ||%0a|| [@thumb@] ||%0a|| [@lframe@] ||frame lfloat||%0a|| [@rframe@] ||frame rfloat||%0a|| [@cframe@] ||%0a|| [@pre@] ||block white-space:pre ||%0a|| [@sidehead@] ||block class:sidehead ||%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%0a----%0a>>faq%3c%3c [[#faq]]%0a!!!FAQ%0aQ:How can I remove underlining from a link, but make it underlined blue when the mouse hovers?%0a%0aA:Put in pub/css/local.css:%0a .noul a {text-decoration: none;}%0a .noul a:hover {text-decoration: underline; color: blue;}%0a%0aThen use this markup:%0a  [@%25noul%25 [[Link]] %25%25@]%0a[[#faqend]]
time=1397894502
