Blob


1 version=pmwiki-2.3.7 ordered=1 urlencoded=1
2 author=simon
3 charset=UTF-8
4 csum=hlt php, pm hlt, hlt css, hlt html (+419)
5 name=PmWiki.CustomWikiStyles
6 rev=66
7 targets=PmWiki.WikiStyles,PmWiki.WikiAdministrator,PmWiki.LayoutVariables,Cookbook.Functions,Cookbook.WikiStylesPlus,Cookbook.Callout
8 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 %25pmhlt%25[@%25define=xxxx color=xxxx%25@]) ||%0a|| [@black@] ||%25hlt php%25[@$WikiStyle['black']['color'] = 'black';@] ||%0a|| [@white@] ||%25hlt php%25[@$WikiStyle['white']['color'] = 'white';@] ||%0a|| [@red@] ||%25hlt php%25[@$WikiStyle['red']['color'] = 'red';@] ||%0a|| [@yellow@] ||%25hlt php%25[@$WikiStyle['yellow']['color'] = 'yellow';@] ||%0a|| [@blue@] ||%25hlt php%25[@$WikiStyle['blue']['color'] = 'blue';@] ||%0a|| [@gray@] ||%25hlt php%25[@$WikiStyle['gray']['color'] = 'gray';@] ||%0a|| [@silver@] ||%25hlt php%25[@$WikiStyle['silver']['color'] = 'silver';@] ||%0a|| [@maroon@] ||%25hlt php%25[@$WikiStyle['maroon']['color'] = 'maroon';@] ||%0a|| [@green@] ||%25hlt php%25[@$WikiStyle['green']['color'] = 'green';@] ||%0a|| [@navy@] ||%25hlt php%25[@$WikiStyle['navy']['color'] = 'navy';@] ||%0a|| [@purple@] ||%25hlt php%25[@$WikiStyle['purple']['color'] = 'purple';@] ||%0a||[[%3c%3c]]'''list-styles:''' ||||%0a|| [@decimal@] ||%25hlt php%25[@$WikiStyle['decimal']['apply'] = 'list';@][[%3c%3c]][@$WikiStyle['decimal']['list-style'] = 'decimal';@] ||%0a|| [@roman@] ||%25hlt php%25[@$WikiStyle['roman']['apply'] = 'list';@][[%3c%3c]][@$WikiStyle['roman']['list-style'] = 'lower-roman';@] ||%0a|| [@ROMAN@] ||%25hlt php%25[@$WikiStyle['ROMAN']['apply'] = 'list';@][[%3c%3c]][@$WikiStyle['ROMAN']['list-style'] = 'upper-roman';@] ||%0a|| [@alpha@] ||%25hlt php%25[@$WikiStyle['alpha']['apply'] = 'list';@][[%3c%3c]][@$WikiStyle['alpha']['list-style'] = 'lower-alpha';@] ||%0a|| [@ALPHA@] ||%25hlt php%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|| [@newwin@] ||%25hlt php%25[@$WikiStyle['newwin']['target'] = '_blank';@] ||%0a||Turns markup into a comment via display:none CSS ||||%0a|| [@comment@] ||%25hlt php%25[@$WikiStyle['comment']['display'] = 'none';@] ||%0a||[[%3c%3c]]'''wiki styles''' ||||%0a|| [@frame@] ||%25hlt css%25@@border:1px solid #cccccc; padding:4px; background-color:#f9f9f9;@@ ||%0a|| [@lfloat@] ||%25hlt css%25@@float:left; margin-right:0.5em;@@ ||%0a|| [@rfloat@] ||%25hlt css%25@@float:right; margin-left:0.5em;@@ ||%0a|| [@thumb@] ||%0a|| [@lframe@] ||%25hlt css%25@@frame lfloat@@ ||%0a|| [@rframe@] ||%25hlt css%25@@frame rfloat@@ ||%0a|| [@cframe@] ||%0a|| [@pre@] ||%25hlt css%25@@block white-space:pre@@ ||%0a|| [@sidehead@] ||%25hlt css%25@@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->%25pmhlt%25[@%25define=projectentry color:red%25@]%0ause%0a->%25hlt php%25[@$WikiStyle['projectentry']['color'] = 'red';@]%0a%0a%0aThe %25hlt php%25[@$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-> %25hlt php%25[@%0a$WikiStyle['top']['apply'] = 'item';%0a$WikiStyle['top']['class'] = 'top';@]%0a%0athen a markup%0a %25pmhlt%25[@* %25top%25 An important list-item@]%0awill output%0a %25hlt html%25[@%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%25hlt php%25[@if($action!="print") {%0a // your custom-styles%0a}@]%0a%0a%0a!!FAQ%0a>>faq%3c%3c [[#faq]]%0aQ: I tried this but background didn't work, though border and float worked?%0a%25hlt php%25[@$WikiStyle['vMenu']['background']='#ffffcc' ;%0a$WikiStyle['vMenu']['float']='left' ;%0a$WikiStyle['vMenu']['border']='1px dotted red' ;%0a@]%0a%0aA: Try using %25hlt php%25[@$WikiStyle['vMenu']['background-color']='#ffffcc';@] -- unlike @@background@@, @@background-color@@ is defined in the $WikiStyleCSS array, which is checked for valid properties.%0a%0a%0aQ: 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%0aA: See [[(Cookbook:)WikiStylesPlus]] and [[(Cookbook:)Callout]].%0a%0a%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-> %25hlt css%25[@.noul a {text-decoration: none;}%0a.noul a:hover {text-decoration: underline; color: blue;}@]%0a%0aThen use this markup:%0a %25pmhlt%25[@%25noul%25 [[Link]] %25%25@]%0a
9 time=1657872988