diff options
author | petko <petko@524c5546-5005-0410-9a3e-e25e191bd360> | 2024-08-18 12:49:32 +0000 |
---|---|---|
committer | petko <petko@524c5546-5005-0410-9a3e-e25e191bd360> | 2024-08-18 12:49:32 +0000 |
commit | cac7ca9a5523d4adaa6d6d0a83a3721e543ca83f (patch) | |
tree | 61d83be31c8389e4d78affe3c12173f6a9bd46fd | |
parent | 6cb6c0ee5a2ca1a270e6695036998067f988323b (diff) | |
download | pmwiki.svn-cac7ca9a5523d4adaa6d6d0a83a3721e543ca83f.tar.bz2 |
Documentation update.
git-svn-id: svn://pmwiki.org/pmwiki/trunk@4778 524c5546-5005-0410-9a3e-e25e191bd360
-rw-r--r-- | wikilib.d/PmWiki.BasicVariables | 12 | ||||
-rw-r--r-- | wikilib.d/PmWiki.LayoutVariables | 10 | ||||
-rw-r--r-- | wikilib.d/PmWiki.Tables | 10 |
3 files changed, 16 insertions, 16 deletions
diff --git a/wikilib.d/PmWiki.BasicVariables b/wikilib.d/PmWiki.BasicVariables index 33558424..cb8542a7 100644 --- a/wikilib.d/PmWiki.BasicVariables +++ b/wikilib.d/PmWiki.BasicVariables @@ -1,9 +1,9 @@ -version=pmwiki-2.3.18 ordered=1 urlencoded=1 +version=pmwiki-2.3.36 ordered=1 urlencoded=1 author=Petko charset=UTF-8 -csum=not "page variable". To see PHP variables go to ?action=diag (-19) (-12) +csum=$EnableCommonEnhancements (+1015) name=PmWiki.BasicVariables -rev=121 -targets=PmWiki.Variables,PmWiki.BasicVariables,PmWiki.AuthoringPhilosophy,PmWiki.EditVariables,PmWiki.AuthUser,PmWiki.Categories,PmWiki.WikiFarms,PmWiki.WikiGroup,PmWiki.GroupCustomizations,PmWiki.LocalCustomizations,PmWiki.LinkVariables,PmWiki.WikiWord,PmWiki.MarkupExpressions,Cookbook.LimitWikiGroups,Site.Search,Site.EditForm,Site.PageNotFound,SiteAdmin.AuthList,SiteAdmin.AuthUser,SiteAdmin.ApprovedUrls,PmWiki.Skins,PmWiki.LayoutVariables,PmWiki.Functions,PmWiki.PageVariables,Category.PmWikiDeveloper,!PmWikiDeveloper -text=(:Summary: core variables:)%0a%0aWhere the [[variables]] are available as wiki markup they are shown as ''Variable value'' "%25pmhlt%25[@{$VariableName}@]".%0a%0a:$AsSpacedFunction:The name of the function used to convert WikiWords into normal, spaced strings. Defaults to '@@AsSpaced@@'.%0a: :%25hlt php%25[@$AsSpacedFunction = 'MyAsSpaced';@]%0a%0a%25rfloat%25$Author is currently "{$Author}"%0a:$Author : Set to the current reader, who is potentially an author ([[PmWiki:AuthoringPhilosophy|see discussion]]). See also $EnablePostAuthorRequired.%0a%0a:$AuthorGroup: The WikiGroup for user profiles. Defaults to '@@Profiles@@'. This variable is implicit in the markup %25pmhlt%25[@[[~AuthorName]]@]%0a: :%25hlt php%25[@$AuthorGroup = 'Users';@]%0a%0a:$AuthId: For sites using [[AuthUser | user-based authorization]], tracks the "reader" or login name.%0a: :%25hlt php%25[@SessionAuth($pagename);@]%0a: :%25hlt php%25[@if( isset($AuthId) ) { // this person has been authenticated@]%0a%0a:$AuthPw: Request for documentation, meanwhile see [[https://www.pmwiki.org/pipermail/pmwiki-users/2006-August/030386.html|AuthId vs AuthPw]].%0a: :%25hlt php%25[@SessionAuth($pagename);@]%0a: :%25hlt php%25[@if( isset($AuthPw) ) { // this person has entered a password@] %0a%0a%25rfloat%25$BaseName is currently "{$BaseName}"%0a:$BaseName:%0a:$BaseNamePatterns:Allows population of the %25pmhlt%25[@{$BaseName}@] PageVariable. The key to the hash is the pattern to be replaced and the value is the replacement string.%0a: :%25hlt php%25[@%0a# If {$FullName} is 'Group.Page-Draft' then {$BaseName} is 'Group.Page'%0a$BaseNamePatterns['/-Draft$/'] = '';%0a# If {$FullName} is 'Comments-Group.Page' then {$BaseName} is 'Group.Page'%0a$BaseNamePatterns['/^Comments-/'] = '';@]%0a%0a:$CategoryGroup: The WikiGroup used for categories. Defaults to '@@Category@@'. (See [[Categories]]). This variable is implicit in the markup %25pmhlt%25[@[[!CategoryName]]@]%0a%0a:$CookiePrefix: A string prefix to be prepended to cookies set from PmWiki scripts. It defaults to '', but can be set to a different value to avoid conflicts with similar-named cookies from other applications, or to allow multiple wikis from the same domain to store separate cookies.%0a: :%25hlt php%25[@$CookiePrefix = 'pmwiki_'; # set cookie prefix to 'pmwiki_'@]%0a::If you have a [[WikiFarm(s)]], use the following in each field's ''@@config.php@@'' to get a unique prefix for each field in the farm, thus isolating each field's cookies.:%0a: :%25hlt php%25[@$CookiePrefix = substr($tmp = md5(__FILE__), 0, 5).'_';@]%0a%0a%25rfloat%25$DefaultGroup is currently "{$DefaultGroup}"%0a:$DefaultGroup:[[WikiGroup]] used by default (on startup) when no group is specified in the URL. %0a%0a%25rfloat%25$DefaultName is currently "{$DefaultName}"%0a:$DefaultName:Name of the default HomePage of each WikiGroup. Used when the group doesn't have a page with the same name as the group.%0a: :Note that the behavior will differ based on whether the page exists or not. Probably you want to alter $PagePathFmt in addition to $DefaultName if you really want it to take effect.%0a-> Note: See comment below under $DefaultPage re the order how this must be defined within your @@(farm)config.php@@ scripts - this must be set prior to any call of %25hlt php%25[@ResolvePageName()@].%0a%0a:$DefaultPage:Startup page when PmWiki is called without a specified page, normally ''@@$DefaultGroup.$DefaultName@@''.%0a-> Note: for @@$DefaultGroup@@, @@$DefaultName@@ and @@$DefaultPage@@ variables to work, they should be defined in the beginning of @@(farm)config.php@@, before any call to the function %25hlt php%25@@ResolvePageName()@@. This means, before any script from PmWiki and before any recipe that might be using this function. This also means it cannot be set in a per-page or per-group customization script - %25hlt php%25@@ResolvePageName()@@ is called before these are loaded.%0a: : Please note that this variable is intended to be set in @@(farm)config.php@@, not in individual groups. Trying to use different @@$DefaultName@@, @@$DefaultPage@@ or@@ $PagePathFmt@@ settings in different groups will cause cross-group linking anomalies.%0a%0a:$EnableLocalConfig:Allows/disables @@local/config.php@@ customizations (usually for a farm's wikis). Can be set to zero in @@local/farmconfig.php@@ to prevent the farm's wikis' @@local/config.php@@ from being loaded.%0a: :%25hlt php%25[@$EnableLocalConfig = 0; # disable PmWiki's local/config@]%0a%0a:$EnableStdConfig:Disables @@scripts/stdconfig.php@@ and a large part of the core functionalities provided by the scripts in the @@pmwiki/scripts@@ directory and outlined in the core documentation, unless included by your own local configuration (notably core markup rules, page history, skins, uploads). Allows you to completely reshape the way PmWiki behaves, if you need to.%0a: :%25hlt php%25[@$EnableStdConfig = 0; # disable many standard features@]%0a%0a%0a:$EnablePGCust:Allows/disables per-page and [[GroupCustomizations | per-group customizations]]. Can be set to zero in any [[local customization(s)]] file to prevent remaining page/group customizations from being loaded.%0a: :%25hlt php%25[@$EnablePGCust = 0; # turn off per-page/group configs@]%0a%0a:$EnableBaseNameConfig:When enabled, and if the page has a different base page (per $BaseNamePatterns), will include the local configuration for the base page. For example, if the page is "Group.Page-Draft", this would try to include the file @@local/Group.Page.php@@ in addition to @@local/Group.Page-Draft.php@@.%0a: :%25hlt php%25[@$EnableBaseNameConfig = 1; # include basename configuration@]%0a%0a:$EnableRedirect:When enabled (default), causes page redirects to automatically be performed by the browser. Setting $EnableRedirect to zero causes PmWiki to pause and issue a "Redirect to ''link''" message instead. This is sometimes useful when debugging recipes to be able to see the results of actions before page redirections occur. Not to be confused with $EnableRedirectQuiet.%0a%0a:$EnableWikiWords:Enable [[WikiWord]] processing.%0a%0a:$EnableWSPre:Enables a markup rule that causes lines with leading spaces to be treated as sections of preformatted text. If set to a value greater than 1, indicates the minimum number of leading spaces required for this treatment.%0a: :%25hlt php%25[@$EnableWSPre = 1; # leading spaces are preformatted text@]%0a: :%25hlt php%25[@$EnableWSPre = 0; # leading spaces are normal lines of text@]%0a: :%25hlt php%25[@$EnableWSPre = 4; # 4+ spaces are preformatted text@]%0a%0a:$FTimeFmt:Can be used to override the default date format used by the "@@ftime@@" function. The default $FTimeFmt is $TimeFmt. (See [[Markup Expressions]].)%0a%0a:$GroupPattern: The regular expression pattern used for valid [[WikiGroup]] name specifications. Defaults to allowing any group name beginning with an uppercase letter, but can be set to limit the valid group names (see Cookbook:LimitWikiGroups).%0a: :%25hlt php%25[@# limit groups to Site, SiteAdmin, PmWiki, and MyGroup@]%0a: :%25hlt php%25[@$GroupPattern = '(?:Site|SiteAdmin|PmWiki|MyGroup)';@]%0a: :%25hlt php%25[@#for case-sensitive group names, note the ?-i switch:@]%0a: :%25hlt php%25[@$GroupPattern = '(?-i:Site|SiteAdmin|PmWiki|MyGroup)';@]%0a%0a:$LinkWikiWords:If set, then bare WikiWords in a page are automatically linked to pages of the same name. Note that this value can also be affected by the %25pmhlt%25[@(:linkwikiwords:)@] and [@(:nolinkwikiwords:)@] directives.%0a: :%25hlt php%25[@$LinkWikiWords = 1; # turn on WikiWord links@]%0a: :%25hlt php%25[@$LinkWikiWords = 0; # disable WikiWord links@]%0a: :Note, this setting requires WikiWords to be enabled, see $EnableWikiWords.%0a%0a:$LogoutRedirectFmt: Identifies the page to which the visitor should be sent after an [@?action=logout@]. Defaults to the current page.%0a: :%25hlt php%25[@$LogoutRedirectFmt = 'Site.Logout'; # ?action=logout target@]%0a%0a:$LogoutCookies: An array of cookie names to be removed when [@?action=logout@] is invoked.%0a%0a:$NamePattern: The regular expression pattern used for valid page names. Defaults to allowing pages beginning with an uppercase letter or digit, followed by sequences of alphanumeric characters, hyphens, and underscores. %0a%0a:$pagename: A variable that gives the name of the current page.%0a->To access inside a Markup callback function, use%0a-->%25hlt php%25[@$pagename=$GLOBALS['MarkupToHTML']['pagename'];@]%0a->It is also accessible via%0a-->%25hlt php%25[@global $pagename;@] # if you use it inside a function%0a-->%25hlt php%25[@$pagename = ResolvePageName($pagename);@]%0a->See [[PmWiki:LocalCustomizations#configphp-group-page|+]] for more information, including when it's possible to use this variable.%0a->Once you have $pagename, page variables become accessible:%0a-->%25hlt php%25[@%0a$page = PageVar($pagename, '$FullName'); # =$pagename%0a$group = PageVar($pagename, '$Group');%0a$name = PageVar($pagename, '$Name');%0a@]%0a%0a:$PagePathFmt: An array controlling how the default group home-page name will be determined.%0a: : Please note that this variable is intended to be set in @@(farm)config.php@@, not in individual groups. Trying to use different @@$DefaultName@@, @@$DefaultPage@@ or @@$PagePathFmt@@ settings in different groups will cause cross-group linking anomalies.%0a-> Default Setting:%0a-->%25hlt php%25[@$PagePathFmt = array('{$Group}.$1','$1.$1','$1.{$DefaultName}');@]%0a-> Setting to use if you wish $DefaultName to actually be the name of your group home-pages:%0a-->%25hlt php%25[@$PagePathFmt = array('{$Group}.$1','$1.{$DefaultName}','$1.$1');@]%0a-> Do note that if the @@Groupname.Groupname@@ page does exist but @@Groupname.Defaultname@@ does not exist, then @@Groupname.Groupname@@ will still take precedence. You may remove the '@@$1.$1@@' entirely to '''require''' @@Groupname.Defaultname@@ to be the group homepage - that would look like this:%0a-->%25hlt php%25[@$PagePathFmt = array('{$Group}.$1','$1.{$DefaultName}');@]%0a%0a%25rfloat%25$SiteGroup is currently "{$SiteGroup}"%0a:$SiteGroup:Default group for storing configuration and utility pages such as [[Site.Search]], [[Site.EditForm]], [[Site.PageNotFound]], etc.%0a%0a:$SiteAdminGroup:Default group for locked administrative pages such as [[SiteAdmin.AuthList]], [[SiteAdmin.AuthUser]], [[SiteAdmin.ApprovedUrls]], etc, defaults to '@@SiteAdmin@@'.%0a%0a:$Skin:The name of the directory containing the skin (theme) files, default "pmwiki". See [[Skins]].%0a%0a:$SpaceWikiWords:If set, then WikiWords in pages are automatically spaced according to $AsSpacedFunction. Note that this value can also be affected by the %25pmhlt%25[@(:spacewikiwords:)@] and [@(:nospacewikiwords:)@] directives.%0a: :%25hlt php%25[@$SpaceWikiWords = 1; # turn on WikiWord spacing@]%0a: :%25hlt php%25[@$SpaceWikiWords = 0; # turn off WikiWord spacing@]%0a%0a:$TimeFmt: The format to use for dates and times, in [[https://www.php.net/manual/en/function.strftime.php | %25hlt php%25@@strftime()@@]] format. The default value is [@'%25B %25d, %25Y at %25I:%25M %25p'@], which gives dates of the form "September 8, 2005 at 10:57 PM". Formats $CurrentTime variable.%0a: :%25hlt php%25[@$TimeFmt = '%25B %25d, %25Y'; # dates as "September 8, 2005"@]%0a: :%25hlt php%25[@$TimeFmt = '%25Y-%25m-%25d'; # dates as "2005-09-08"@]%0a%0a%0a:$EnableFTimeNew: If set to 1, enables the new functions to format dates and times for PHP before 8.1. This allows you to preview the outputs of dates and times, for example in the page footer, in Recent Changes and page histories, or with the %25pmhlt%25[@{(ftime)}@] markup expression. See explanation at [[Functions#PSFT]]. (For PHP 8.1, strftime() is deprecated, and the new functions are enabled by default.)%0a%0a%0a%25rfloat%25$Version is currently "{$Version}"%0a:$Version: A string representing the release version of PmWiki.%0a%0a%25rfloat%25$VersionNum is currently "{$VersionNum}"%0a:$VersionNum: A number representing the release version of PmWiki,%0a with the major and minor release components padded with zeroes to%0a produce three digits. Thus, release "pmwiki-2.1.40" will have $VersionNum set to 2001040.%0a%0a The first digit is a 2, the next three digits are the major%0a release number, and the last three digits are the minor release%0a number. Beta releases use 900-999 for the minor release number.%0a Thus:%0a--> [@%0a2.1.0 2001000%0a2.1.1 2001001%0a...%0a2.1.27 2001027%0a2.2.0-beta1 2001901%0a2.2.0-beta2 2001902%0a...%0a2.2.0-beta18 2001918%0a...%0a2.2.0 2002000%0a@]%0a%0a:$WikiWordPattern: The pattern that describes a WikiWord.%0a%0a:$EnableRelativePageVars:This setting controls how [[Page variables]] in included pages are understood by PmWiki.%0a: :%25hlt php%25@@$EnableRelativePageVars = 1; # PmWiki current default@@\\%0aIn this case %25pmhlt%25@@[={$Name}=]@@ displays the name of the physical page where it written. If @@[={$Name}=]@@ is in an included page, it will display the name of the included page. (This is currently PmWiki's default.)%0a: :%25hlt php%25@@$EnableRelativePageVars = 0; # revert to previous default@@\\%0aIn this case %25pmhlt%25@@[={$Name}=]@@ displays the name of the currently browsed page. Even if @@[={$Name}=]@@ is in an included page, it will display the name of the browsed page. This was PmWiki's default in versions 2.2.8 and earlier, and changed in 2.2.9, but you can revert it back with this line in config.php.%0a: : %25pmhlt%25@@[={*$Name}=]@@ with an asterisk always displays the name of the currently browsed page, regardless of $EnableRelativePageVars.%0a%0aCategories: [[!PmWiki Developer]] -time=1674963286 +rev=122 +targets=PmWiki.Variables,PmWiki.BasicVariables,PmWiki.AuthoringPhilosophy,PmWiki.EditVariables,PmWiki.AuthUser,PmWiki.Categories,PmWiki.WikiFarms,PmWiki.WikiGroup,PmWiki.SecurityVariables,Cookbook.DeObMail,PmWiki.LayoutVariables,PmWiki.UploadVariables,PmWiki.GroupCustomizations,PmWiki.LocalCustomizations,PmWiki.LinkVariables,PmWiki.WikiWord,PmWiki.MarkupExpressions,Cookbook.LimitWikiGroups,Site.Search,Site.EditForm,Site.PageNotFound,SiteAdmin.AuthList,SiteAdmin.AuthUser,SiteAdmin.ApprovedUrls,PmWiki.Skins,PmWiki.Functions,PmWiki.PageVariables,Category.PmWikiDeveloper,!PmWikiDeveloper +text=(:Summary: core variables:)%0a%0aWhere the [[variables]] are available as wiki markup they are shown as ''Variable value'' "%25pmhlt%25[@{$VariableName}@]".%0a%0a:$AsSpacedFunction:The name of the function used to convert WikiWords into normal, spaced strings. Defaults to '@@AsSpaced@@'.%0a: :%25hlt php%25[@$AsSpacedFunction = 'MyAsSpaced';@]%0a%0a%25rfloat%25$Author is currently "{$Author}"%0a:$Author : Set to the current reader, who is potentially an author ([[PmWiki:AuthoringPhilosophy|see discussion]]). See also $EnablePostAuthorRequired.%0a%0a:$AuthorGroup: The WikiGroup for user profiles. Defaults to '@@Profiles@@'. This variable is implicit in the markup %25pmhlt%25[@[[~AuthorName]]@]%0a: :%25hlt php%25[@$AuthorGroup = 'Users';@]%0a%0a:$AuthId: For sites using [[AuthUser | user-based authorization]], tracks the "reader" or login name.%0a: :%25hlt php%25[@SessionAuth($pagename);@]%0a: :%25hlt php%25[@if( isset($AuthId) ) { // this person has been authenticated@]%0a%0a:$AuthPw: Request for documentation, meanwhile see [[https://www.pmwiki.org/pipermail/pmwiki-users/2006-August/030386.html|AuthId vs AuthPw]].%0a: :%25hlt php%25[@SessionAuth($pagename);@]%0a: :%25hlt php%25[@if( isset($AuthPw) ) { // this person has entered a password@] %0a%0a%25rfloat%25$BaseName is currently "{$BaseName}"%0a:$BaseName:%0a:$BaseNamePatterns:Allows population of the %25pmhlt%25[@{$BaseName}@] PageVariable. The key to the hash is the pattern to be replaced and the value is the replacement string.%0a: :%25hlt php%25[@%0a# If {$FullName} is 'Group.Page-Draft' then {$BaseName} is 'Group.Page'%0a$BaseNamePatterns['/-Draft$/'] = '';%0a# If {$FullName} is 'Comments-Group.Page' then {$BaseName} is 'Group.Page'%0a$BaseNamePatterns['/^Comments-/'] = '';@]%0a%0a:$CategoryGroup: The WikiGroup used for categories. Defaults to '@@Category@@'. (See [[Categories]]). This variable is implicit in the markup %25pmhlt%25[@[[!CategoryName]]@]%0a%0a:$CookiePrefix: A string prefix to be prepended to cookies set from PmWiki scripts. It defaults to '', but can be set to a different value to avoid conflicts with similar-named cookies from other applications, or to allow multiple wikis from the same domain to store separate cookies.%0a: :%25hlt php%25[@$CookiePrefix = 'pmwiki_'; # set cookie prefix to 'pmwiki_'@]%0a::If you have a [[WikiFarm(s)]], use the following in each field's ''@@config.php@@'' to get a unique prefix for each field in the farm, thus isolating each field's cookies.:%0a: :%25hlt php%25[@$CookiePrefix = substr($tmp = md5(__FILE__), 0, 5).'_';@]%0a%0a%25rfloat%25$DefaultGroup is currently "{$DefaultGroup}"%0a:$DefaultGroup:[[WikiGroup]] used by default (on startup) when no group is specified in the URL. %0a%0a%25rfloat%25$DefaultName is currently "{$DefaultName}"%0a:$DefaultName:Name of the default HomePage of each WikiGroup. Used when the group doesn't have a page with the same name as the group.%0a: :Note that the behavior will differ based on whether the page exists or not. Probably you want to alter $PagePathFmt in addition to $DefaultName if you really want it to take effect.%0a-> Note: See comment below under $DefaultPage re the order how this must be defined within your @@(farm)config.php@@ scripts - this must be set prior to any call of %25hlt php%25[@ResolvePageName()@].%0a%0a:$DefaultPage:Startup page when PmWiki is called without a specified page, normally ''@@$DefaultGroup.$DefaultName@@''.%0a-> Note: for @@$DefaultGroup@@, @@$DefaultName@@ and @@$DefaultPage@@ variables to work, they should be defined in the beginning of @@(farm)config.php@@, before any call to the function %25hlt php%25@@ResolvePageName()@@. This means, before any script from PmWiki and before any recipe that might be using this function. This also means it cannot be set in a per-page or per-group customization script - %25hlt php%25@@ResolvePageName()@@ is called before these are loaded.%0a: : Please note that this variable is intended to be set in @@(farm)config.php@@, not in individual groups. Trying to use different @@$DefaultName@@, @@$DefaultPage@@ or@@ $PagePathFmt@@ settings in different groups will cause cross-group linking anomalies.%0a%0a:$EnableCommonEnhancements:This variable enables popular core functions for easier editing and review:%0a: : %25hlt php%25 @@$EnableCommonEnhancements = 1;@@%0a: : In this case, the following configuration options are enabled, unless they are already defined or disabled in config.php (click on each variable to learn more):%0a>>hlt php%3c%3c%0a # Security + review changes%0a $EnableCookieHTTPOnly = 1;%0a $LinkFunctions['mailto:'] = 'ObfuscateLinkIMap'; # See Cookbook:DeObMail%0a $EnableRCDiffBytes = 1;%0a $EnableLocalTimes = 3;%0a %0a # Editing%0a $EnablePreviewChanges = 1;%0a $EnableMergeLastMinorEdit = 1;%0a $EnableListIncludedPages = 1;%0a $EnablePmSyntax = 2;%0a $EnableEditAutoText = 1;%0a $EnableGUIButtons = 1;%0a $EnableGuiEditFixUrl = 220; # after external link button%0a%0a # Documentation%0a $PmTOC['Enable'] = 1; $PmTOC['EnableBacklinks'] = 1;%0a $EnableCopyCode = 1;%0a %0a # Uploads (if enabled)%0a $EnableUploadDrop = 1;%0a $EnableRecentUploads = 1;%0a $EnableUploadVersions = 1;%0a>>%3c%3c%0a%0a:$EnableLocalConfig:Allows/disables @@local/config.php@@ customizations (usually for a farm's wikis). Can be set to zero in @@local/farmconfig.php@@ to prevent the farm's wikis' @@local/config.php@@ from being loaded.%0a: :%25hlt php%25[@$EnableLocalConfig = 0; # disable PmWiki's local/config@]%0a%0a:$EnableStdConfig:Disables @@scripts/stdconfig.php@@ and a large part of the core functionalities provided by the scripts in the @@pmwiki/scripts@@ directory and outlined in the core documentation, unless included by your own local configuration (notably core markup rules, page history, skins, uploads). Allows you to completely reshape the way PmWiki behaves, if you need to.%0a: :%25hlt php%25[@$EnableStdConfig = 0; # disable many standard features@]%0a%0a%0a:$EnablePGCust:Allows/disables per-page and [[GroupCustomizations | per-group customizations]]. Can be set to zero in any [[local customization(s)]] file to prevent remaining page/group customizations from being loaded.%0a: :%25hlt php%25[@$EnablePGCust = 0; # turn off per-page/group configs@]%0a%0a:$EnableBaseNameConfig:When enabled, and if the page has a different base page (per $BaseNamePatterns), will include the local configuration for the base page. For example, if the page is "Group.Page-Draft", this would try to include the file @@local/Group.Page.php@@ in addition to @@local/Group.Page-Draft.php@@.%0a: :%25hlt php%25[@$EnableBaseNameConfig = 1; # include basename configuration@]%0a%0a:$EnableRedirect:When enabled (default), causes page redirects to automatically be performed by the browser. Setting $EnableRedirect to zero causes PmWiki to pause and issue a "Redirect to ''link''" message instead. This is sometimes useful when debugging recipes to be able to see the results of actions before page redirections occur. Not to be confused with $EnableRedirectQuiet.%0a%0a:$EnableWikiWords:Enable [[WikiWord]] processing.%0a%0a:$EnableWSPre:Enables a markup rule that causes lines with leading spaces to be treated as sections of preformatted text. If set to a value greater than 1, indicates the minimum number of leading spaces required for this treatment.%0a: :%25hlt php%25[@$EnableWSPre = 1; # leading spaces are preformatted text@]%0a: :%25hlt php%25[@$EnableWSPre = 0; # leading spaces are normal lines of text@]%0a: :%25hlt php%25[@$EnableWSPre = 4; # 4+ spaces are preformatted text@]%0a%0a:$FTimeFmt:Can be used to override the default date format used by the "@@ftime@@" function. The default $FTimeFmt is $TimeFmt. (See [[Markup Expressions]].)%0a%0a:$GroupPattern: The regular expression pattern used for valid [[WikiGroup]] name specifications. Defaults to allowing any group name beginning with an uppercase letter, but can be set to limit the valid group names (see Cookbook:LimitWikiGroups).%0a: :%25hlt php%25[@# limit groups to Site, SiteAdmin, PmWiki, and MyGroup@]%0a: :%25hlt php%25[@$GroupPattern = '(?:Site|SiteAdmin|PmWiki|MyGroup)';@]%0a: :%25hlt php%25[@#for case-sensitive group names, note the ?-i switch:@]%0a: :%25hlt php%25[@$GroupPattern = '(?-i:Site|SiteAdmin|PmWiki|MyGroup)';@]%0a%0a:$LinkWikiWords:If set, then bare WikiWords in a page are automatically linked to pages of the same name. Note that this value can also be affected by the %25pmhlt%25[@(:linkwikiwords:)@] and [@(:nolinkwikiwords:)@] directives.%0a: :%25hlt php%25[@$LinkWikiWords = 1; # turn on WikiWord links@]%0a: :%25hlt php%25[@$LinkWikiWords = 0; # disable WikiWord links@]%0a: :Note, this setting requires WikiWords to be enabled, see $EnableWikiWords.%0a%0a:$LogoutRedirectFmt: Identifies the page to which the visitor should be sent after an [@?action=logout@]. Defaults to the current page.%0a: :%25hlt php%25[@$LogoutRedirectFmt = 'Site.Logout'; # ?action=logout target@]%0a%0a:$LogoutCookies: An array of cookie names to be removed when [@?action=logout@] is invoked.%0a%0a:$NamePattern: The regular expression pattern used for valid page names. Defaults to allowing pages beginning with an uppercase letter or digit, followed by sequences of alphanumeric characters, hyphens, and underscores. %0a%0a:$pagename: A variable that gives the name of the current page.%0a->To access inside a Markup callback function, use%0a-->%25hlt php%25[@$pagename=$GLOBALS['MarkupToHTML']['pagename'];@]%0a->It is also accessible via%0a-->%25hlt php%25[@global $pagename;@] # if you use it inside a function%0a-->%25hlt php%25[@$pagename = ResolvePageName($pagename);@]%0a->See [[PmWiki:LocalCustomizations#configphp-group-page|+]] for more information, including when it's possible to use this variable.%0a->Once you have $pagename, page variables become accessible:%0a-->%25hlt php%25[@%0a$page = PageVar($pagename, '$FullName'); # =$pagename%0a$group = PageVar($pagename, '$Group');%0a$name = PageVar($pagename, '$Name');%0a@]%0a%0a:$PagePathFmt: An array controlling how the default group home-page name will be determined.%0a: : Please note that this variable is intended to be set in @@(farm)config.php@@, not in individual groups. Trying to use different @@$DefaultName@@, @@$DefaultPage@@ or @@$PagePathFmt@@ settings in different groups will cause cross-group linking anomalies.%0a-> Default Setting:%0a-->%25hlt php%25[@$PagePathFmt = array('{$Group}.$1','$1.$1','$1.{$DefaultName}');@]%0a-> Setting to use if you wish $DefaultName to actually be the name of your group home-pages:%0a-->%25hlt php%25[@$PagePathFmt = array('{$Group}.$1','$1.{$DefaultName}','$1.$1');@]%0a-> Do note that if the @@Groupname.Groupname@@ page does exist but @@Groupname.Defaultname@@ does not exist, then @@Groupname.Groupname@@ will still take precedence. You may remove the '@@$1.$1@@' entirely to '''require''' @@Groupname.Defaultname@@ to be the group homepage - that would look like this:%0a-->%25hlt php%25[@$PagePathFmt = array('{$Group}.$1','$1.{$DefaultName}');@]%0a%0a%25rfloat%25$SiteGroup is currently "{$SiteGroup}"%0a:$SiteGroup:Default group for storing configuration and utility pages such as [[Site.Search]], [[Site.EditForm]], [[Site.PageNotFound]], etc.%0a%0a:$SiteAdminGroup:Default group for locked administrative pages such as [[SiteAdmin.AuthList]], [[SiteAdmin.AuthUser]], [[SiteAdmin.ApprovedUrls]], etc, defaults to '@@SiteAdmin@@'.%0a%0a:$Skin:The name of the directory containing the skin (theme) files, default "pmwiki". See [[Skins]].%0a%0a:$SpaceWikiWords:If set, then WikiWords in pages are automatically spaced according to $AsSpacedFunction. Note that this value can also be affected by the %25pmhlt%25[@(:spacewikiwords:)@] and [@(:nospacewikiwords:)@] directives.%0a: :%25hlt php%25[@$SpaceWikiWords = 1; # turn on WikiWord spacing@]%0a: :%25hlt php%25[@$SpaceWikiWords = 0; # turn off WikiWord spacing@]%0a%0a:$TimeFmt: The format to use for dates and times, in [[https://www.php.net/manual/en/function.strftime.php | %25hlt php%25@@strftime()@@]] format. The default value is [@'%25B %25d, %25Y at %25I:%25M %25p'@], which gives dates of the form "September 8, 2005 at 10:57 PM". Formats $CurrentTime variable.%0a: :%25hlt php%25[@$TimeFmt = '%25B %25d, %25Y'; # dates as "September 8, 2005"@]%0a: :%25hlt php%25[@$TimeFmt = '%25Y-%25m-%25d'; # dates as "2005-09-08"@]%0a%0a%0a:$EnableFTimeNew: If set to 1, enables the new functions to format dates and times for PHP before 8.1. This allows you to preview the outputs of dates and times, for example in the page footer, in Recent Changes and page histories, or with the %25pmhlt%25[@{(ftime)}@] markup expression. See explanation at [[Functions#PSFT]]. (For PHP 8.1, strftime() is deprecated, and the new functions are enabled by default.)%0a%0a%0a%25rfloat%25$Version is currently "{$Version}"%0a:$Version: A string representing the release version of PmWiki.%0a%0a%25rfloat%25$VersionNum is currently "{$VersionNum}"%0a:$VersionNum: A number representing the release version of PmWiki,%0a with the major and minor release components padded with zeroes to%0a produce three digits. Thus, release "pmwiki-2.1.40" will have $VersionNum set to 2001040.%0a%0a The first digit is a 2, the next three digits are the major%0a release number, and the last three digits are the minor release%0a number. Beta releases use 900-999 for the minor release number.%0a Thus:%0a--> [@%0a2.1.0 2001000%0a2.1.1 2001001%0a...%0a2.1.27 2001027%0a2.2.0-beta1 2001901%0a2.2.0-beta2 2001902%0a...%0a2.2.0-beta18 2001918%0a...%0a2.2.0 2002000%0a@]%0a%0a:$WikiWordPattern: The pattern that describes a WikiWord.%0a%0a:$EnableRelativePageVars:This setting controls how [[Page variables]] in included pages are understood by PmWiki.%0a: :%25hlt php%25@@$EnableRelativePageVars = 1; # PmWiki current default@@\\%0aIn this case %25pmhlt%25@@[={$Name}=]@@ displays the name of the physical page where it written. If @@[={$Name}=]@@ is in an included page, it will display the name of the included page. (This is currently PmWiki's default.)%0a: :%25hlt php%25@@$EnableRelativePageVars = 0; # revert to previous default@@\\%0aIn this case %25pmhlt%25@@[={$Name}=]@@ displays the name of the currently browsed page. Even if @@[={$Name}=]@@ is in an included page, it will display the name of the browsed page. This was PmWiki's default in versions 2.2.8 and earlier, and changed in 2.2.9, but you can revert it back with this line in config.php.%0a: : %25pmhlt%25@@[={*$Name}=]@@ with an asterisk always displays the name of the currently browsed page, regardless of $EnableRelativePageVars.%0a%0aCategories: [[!PmWiki Developer]] +time=1723975967 diff --git a/wikilib.d/PmWiki.LayoutVariables b/wikilib.d/PmWiki.LayoutVariables index 4866e3b4..ad6462b9 100644 --- a/wikilib.d/PmWiki.LayoutVariables +++ b/wikilib.d/PmWiki.LayoutVariables @@ -1,9 +1,9 @@ -version=pmwiki-2.3.34 ordered=1 urlencoded=1 +version=pmwiki-2.3.36 ordered=1 urlencoded=1 author=Petko charset=UTF-8 -csum=typo (+3) +csum=$EnableSortable, $EnableSimpleTableRowspan enabled since 2.3.37 (+12) name=PmWiki.LayoutVariables -rev=186 +rev=187 targets=PmWiki.LayoutVariables,PmWiki.BasicVariables,PmWiki.AvailableActions,PmWiki.PageVariables,PmWiki.PageDirectives,PmWiki.PageHistory,Cookbook.DarkColorScheme,PmWiki.UploadVariables,Cookbook.LocalTimes,Cookbook.PmSyntax,Cookbook.CustomSyntax,PmWiki.WikiStyles,PmWiki.SkinTemplates,PmWiki.WikiGroup,PmWiki.Questions,Cookbook.CustomRecentChanges,Cookbook.RecentUploadsLog,PmWiki.CustomWikiStyles,Cookbook.LocalCSS,PmWiki.TableOfContents,Cookbook.ToggleNext,PmWiki.PathVariables,PmWiki.Tables,PITS.00638,Cookbook.RowspanInSimpleTables,PmWiki.TableDirectives,PmWiki.Skins,Skins.SkinChange,PmWiki.WikiTrails,PmWiki.OtherVariables,PmWiki.EditVariables -text=(:Summary:variables that control page layout:)%0aVariable substitutions in the skin template are all managed by the %25hlt php%25@@`FmtPageName()@@ %25%25function from @@pmwiki.php@@. Pmwiki variable substitutions available on pages are managed by the {$var} substitutions from @@stdmarkup.php@@ or superseded in @@local/config@@ files. %0a%0a:$ActionSkin:This array is used to override the current skin when performing a given action. The most common use is to set %25hlt php%25@@$ActionSkin['print']='foo'@@ to use the 'foo' skin when printing, regardless of what the @@$Skin@@ variable is set to.%0a%0a:$ActionTitleFmt: An array that adds a separator and the current [[PmWiki:AvailableActions|wiki action]] ('edit', 'attr', 'diff', 'upload'...) to the HTML title of the page (the $ActionTitle variable in $HTMLTitleFmt or the skin template). By default it is localized [@"| action"@], but you can change it:%0a: : %25hlt php%25[@$ActionTitleFmt['edit'] = ': $[Edit]';@] # use a ":" colon separator%0a: : %25hlt php%25[@$ActionTitleFmt['edit'] = ' $[Edit] ';@] # space separator, may be placed at the start of $HTMLTitleFmt%0a%0a:$WikiTitle:A variable which contains the Wiki title as displayed in the browser tab and at the top of the browser window, e.g. "{$WikiTitle}"%0a%0a:$HTMLTitleFmt:A variable that overrides the content of the %25hlt html%25[@%3ctitle>...%3c/title>@]%25%25 element in the skin template. Here you can set this format without editing the skin template. For example:%0a: : %25hlt php%25@@$HTMLTitleFmt = '$Title | $WikiTitle $ActionTitle';@@ # Page title first, then $WikiTitle, then the action e.g. "| Edit", and the wiki group $Group is omitted.%0a: : %25hlt php%25@@$HTMLTitleFmt = '$Title | $GroupHomePageTitle';@@ # Page title first, then the title of the group landing page, see [[PageVariables]].%0a%0a:$EnablePageTitlePriority:A variable defining how to treat multiple %25pmhlt%25[@(:title ...:)@] [[page directives]] (added in PmWiki 2.2.9).%0a: : %25hlt php%25@@$EnablePageTitlePriority = 0;@@ # PmWiki default, last encountered title wins (the title may be changed from included pages or GroupFooter).%0a: : %25hlt php%25@@$EnablePageTitlePriority = 1;@@ # First title wins; if a title is defined in the page, directives from included pages cannot change it.%0a%0a:$EnableDiffInline:If set to 0, this variable switches off the word-level highlighting on the markup in the [[page history]].%0a: : %25hlt php%25@@$EnableDiffInline = 0;@@ # Disable colors, show plain text differences%0a%0a:$EnableRCDiffBytes:If set to 1, @@(All)RecentChanges@@ pages will display the difference in bytes of the page content from the previous version like %25diffmarkup%25{+(+123)+} or {-(-42)-}%25%25%0a: : %25hlt php%25@@$EnableRCDiffBytes = 1;@@ # Show bytes difference from previous version%0a%0a: : The colors are the same as those in the page history; if your skin doesn't provide them, add to ''@@pub/css/local.css@@'' something like: %25hlt css%25[@%0a.diffmarkup { font-family: monospace; font-size: 0.9em; } %0a.diffmarkup del { background: #ff9; text-decoration: none; }%0a.diffmarkup ins { background: #9f9; text-decoration: none; }@]%0a%0a:$CurrentTime: This variable contains the current date and time formatted with $TimeFmt. It is used in @@RecentChanges@@ (before 2.3.0), and in user signatures.%0a%0a:$CurrentLocalTime: This variable contains the current date and time stamp, saved in @@RecentChanges@@ (since 2.3.0). This time stamp will be saved in the wiki source text in Greenwich Mean Time (UTC/GMT), but will be shown according to $TimeFmt in the timezone of the wiki. When $EnableLocalTimes is enabled, then it will be shown in the visitor's time zone. The same format is also saved in user signatures if $EnableLocalTimes is enabled.%0a%0a:$EnablePmUtils: This variable controls whether the script @@pub/pmwiki-utils.js@@ should be loaded or not. The script contains JavaScript utility functions for the table of contents, the syntax highlighting, the recent changes, and the email obfuscation, and the dark color theme. By default $EnablePmUtils is 1 (enabled), but most functions need to be enabled individually ($EnableLocalTimes, $EnableHighlight, $PmTOC, $LinkFunctions['mailto:'], $EnableCopyCode, $EnableSortable, $ToggleNextSelector, $EnablePmSyntax, $CustomSyntax, $EnableCopyCode, $EnableDarkThemeToggle). Set this variable to 0 to disable all these functions.%0a%0a:$EnableDarkThemeToggle: This variable enables the core functions for toggling a dark color scheme, if the skin supports this feature, see Cookbook:DarkColorScheme. Can be set in a skin.php file (as global variable) or in config.php:%0a: : %25hlt php%25@@ $EnableDarkThemeToggle = 0; @@ dark theme toggling is disabled, even if the skin supports it%0a: : %25hlt php%25@@ $EnableDarkThemeToggle = 1; @@ dark theme toggling is enabled, with light theme by default%0a: : %25hlt php%25@@ $EnableDarkThemeToggle = 2; @@ dark theme toggling is enabled, with dark theme by default%0a: : %25hlt php%25@@ $EnableDarkThemeToggle = 3; @@ use automatically the theme preferred by the browser%0a: : See also $ImgDarkSuffix.%0a%0a:$EnableLocalTimes: (Default disabled) Enables the rewriting of date and time stamps into the timezone of the visitor, see documentation at Cookbook:LocalTimes. Dates affected are in RecentChanges pages, in page histories, and in user signatures.%0a: : %25hlt php%25@@ $EnableLocalTimes = 2; @@ Enables '''long''' local times, as in MM/DD/YYYY HH:MM:SS.%0a: : %25hlt php%25@@ $EnableLocalTimes = 1; @@ Enables '''compact''' local times, either HH:MM (within 24 hours), MM/DD or DD/MM (within 11 months), and MM/DD/YYYY or DD/MM/YYYY if earlier than 11 months. The long format appears in a tooltip title when the mouse is over the short format.%0a: : %25hlt php%25@@ $EnableLocalTimes = 3; @@ Like the '''compact''' local times, but when the date is earlier than 11 months, shows MM'YY.%0a%0a:$EnablePmSyntax: (Not to be confused with $EnableHighlight) When set to 1, enables [[Cookbook:PmSyntax|PmSyntax]], a syntax highlighting for the PmWiki markup language, which makes the documentation easy to read (from 2.3.0). When set to 2, it also enables the experimental syntax highlighting in the basic edit form: %25hlt php%25[@%0a$EnablePmSyntax = 1; # highlight documentation blocks%0a$EnablePmSyntax = 2; # both documentation and edit form%0aif ($action=='edit') $EnablePmSyntax = 2; # only edit form@]%0a%0a:$CustomSyntax:(From 2.3.0) An array where custom rules for syntax highlighting can be defined. See documentation at Cookbook:CustomSyntax.%0a%0a:$EnableHighlight: (Not to be confused with $EnablePmSyntax) If set to 1, enables compatibility with the [[https://github.com/highlightjs/highlight.js|highlight.js]] library to highlight program code. In addition, you need to include the library and mark your code blocks with the wikistyle [@%25highlight%25@], see [[WikiStyles#highlight]].%0a%0a:$EnableCopyCode: (From 2.3.21) When set to 1, adds a [@[+]@] button near the top right of preformatted blocks. A user clicking on the button will have the text of the preformatted block copied to their system clipboard: %25hlt php%25[@%0a$EnableCopyCode = 1; # add a [+] copy code button to pre blocks@]%0a%0a:$HTMLTagAttr:A string containing attributes of the %25hlt html%25@@%3chtml...>@@ tag in the skin template, default empty. For example, to add a "lang" attribute, set in @@config.php@@: %25hlt php%25[@%0a$HTMLTagAttr = 'lang="en" xml:lang="en"';@]%0a: : For this variable to work in a custom skin, add it in the template file, for example:%25hlt html%25[@%0a%3chtml xmlns="http://www.w3.org/1999/xhtml" $HTMLTagAttr>@]%0a%0a:$HTMLStylesFmt:An array of CSS statements to be included in the page's output along with other HTML headers. This array provides an easy place for scripts to add custom CSS statements.%0a%0a:$HTMLHeaderFmt:An array of HTML text to be included in the page's %25hlt html%25@@%3chead>@@ section, at the point where the [[skin template(s)]] specifies a [@%3c!--HTMLHeader-->@] directive. This array provides an easy place for scripts to add custom HTML headers.%0a%0a->For example, if you want to specify a [[Wikipedia:Favicon|favicon]] for all the pages of your wiki (a png image for Firefox (and others...), an ico for Internet Explorer):%0a-->%25hlt php%25[@%0a$HTMLHeaderFmt['favicon'] =%0a'%3clink href="http://path/to/icon.png" type="image/png" rel="icon" />%0a %3clink href="http://path/to/icon.ico" type="image/x-icon" rel="shortcut icon" />';%0a@]%0a%0a->Another example, if you want to get the RSS notification on some browsers (the RSS icon in Firefox for instance):%0a-->%25hlt php%25[@%0a$HTMLHeaderFmt['rss'] =%0a'%3clink rel="alternate" type="application/rss+xml" title="Rss All recent Changes" %0a href="$ScriptUrl/Site/AllRecentChanges?action=rss" />';%0a@]%0a%0a->Javascript example%0a-->%25hlt php%25[@%0a$HTMLHeaderFmt['the-javascript'] =%0a'%3cscript>%0a // the javascript code%0a %3c/script>';@]%0a%0a:$HTMLFooterFmt:Like $HTMLHeaderFmt above, this contains an array of HTML text to be included near the end of an HTML document, at the point where the [[skin template(s)]] specifies a %25hlt php%25[@%3c!--HTMLFooter-->@] directive (usually just before a closing @@%3c/body>@@ tag). Primarily used by scripts to add custom HTML output after the body of the page output. %0a%0a:$MetaRobots:Sets the value of the %25hlt php%25[@%3cmeta name='robots' ... />@] tag generated by PmWiki to control search engine robots accessing the site. PmWiki's default setting tells robots to not index anything but the normal page view, and to not index pages in the PmWiki [[wiki group]]. Explicitly setting $MetaRobots overrides this default.%0a--> %25hlt php%25[@# never index this site%0a$MetaRobots = 'noindex,nofollow';%0a# disable the robots tag entirely%0a$MetaRobots = ''; @]%0a%0a:$MessagesFmt:An array of HTML text to be displayed at the point of any %25pmhlt%25[@(:messages:)@] markup. Commonly used for displaying messages with respect to editing pages.%0a%0a:$RecentChangesFmt:An array specifying the format of the RecentChanges listing.%0a%0a->The key of the array specifies the page where changes will be logged, as in%0a-->%25hlt php%25[@%0a$RecentChangesFmt['$SiteGroup.AllRecentChanges']%0a@]%0a->The value of the array specifies the format in which the changes will be logged, as in%0a-->%25pmhlt%25[@%0a'* [[{$Group}.{$Name}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]'%0a@]%0a->Note the two consecutive spaces before the three dots (@@. . .@@). The two spaces separate two parts of the format: the first part doesn't change (e.g. a link to the changed page) and the second part does change (e.g. the date and author of the change). Upon saving a page, PmWiki removes a line that matches the first part and adds a line with the current format before the first line with 2 spaces. This way, any line without two consecutive spaces stays at the top of the recent changes page.%0a%0a->You can use and adapt the following to change the format (put it in config.php):%0a-->%25hlt php%25[@%0a$RecentChangesFmt['$SiteGroup.AllRecentChanges'] = %0a '* [[{$Group}.{$Name}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]';%0a$RecentChangesFmt['$Group.RecentChanges'] =%0a '* [[{$Group}/{$Name}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]';%0a@]%0a-> Since PmWiki 2.3.0, the format uses $CurrentLocalTime by default which shows exactly what $CurrentTime previously showed, but when $EnableLocalTimes is set, will rewrite the time and date in the local format and timezone of the visitor. %0a%0a->Note that changes made to the format will only affect new edits. In other words, you will need to edit a page for your new format to be visible. Note also that you need to have two spaces between the page name and the other information about the edit.%0a%0a->Also note that this variable has other uses, such as not reporting at all to RecentChanges and AllRecentChanges as found here [[PmWiki:Questions|PmWiki Questions]]. More informations on customizing RecentChanges pages here : [[Cookbook/CustomRecentChanges]].%0a%0a:$RecentUploadsFmt:An array specifying the format for uploaded files at the RecentChanges listing. It is similar to $RecentChangesFmt. If enabled, newly uploaded files will be logged to the RecentChanges pages. Default is disabled. See Cookbook:RecentUploadsLog for more information. See also $EnableRecentUploads.%0a%0a:$EnableRecentUploads: When set to 1, and when $RecentUploadsFmt is not set, it enables Recent uploads in a default format, only on the page Site.AllRecentChanges. This was added in 2.3.0 to easily enable the feature with some default settings that may be good enough for many wikis.%0a%0a:$DraftRecentChangesFmt:An array specifying the format of the RecentChanges listing when saving Draft pages.%0a%0a->$RecentChangesFmt is set to $DraftRecentChangesFmt when a Draft page is saved. For example, you could save drafts in a separate Recent Draft Changes page and not list in the normal group's Recent Changes page:%0a-->%25hlt php%25[@%0a$DraftRecentChangesFmt['$Group.RecentDraftChanges'] =%0a '* [[{$Group}/{$Name}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]';%0a$DraftRecentChangesFmt['$Group.RecentChanges'] = '';%0a@]%0a%0a:$RCLinesMax:The maximum number of lines to be stored in RecentChanges pages. The default is zero, meaning "no limit".%0a $RCLinesMax = 1000; # maintain at most 1000 recent changes%0a%0a:$PageRedirectFmt:The text to be used when a page is redirected via the [@(:redirect:)@] markup.%0a-->%25hlt php%25[@%0a$PageRedirectFmt = '%3cp>%3ci>redirected from $FullName%3c/p>';%0a$PageRedirectFmt = '';%0a@]%0a->For display options, see also the FAQ on [[(PmWiki:)PageDirectives(#faq)]].%0a%0a:$WikiStyle:An array which contains the predefined WikiStyles which can be used on a textpage.[[%3c%3c]]See: [[PmWiki.CustomWikiStyles]]%0a%0a:$WikiStyleApply:An array which defines the scope of wiki styling per HTML element. Default settings are:%0a->%25hlt php%25[@%0a'item' => 'li|dt',%0a'list' => 'ul|ol|dl',%0a'div' => 'div',%0a'pre' => 'pre',%0a'img' => 'img',%0a'block' => 'p(?!\\sclass=)|div|ul|ol|dl|li|dt|pre|h[1-6]',%0a'p' => 'p(?!\\sclass=)'%0a@]%0a%0a->This defines that we can apply wiki styling on:%0a* LI elements using the ''item'' keyword%0a* UL, OL, DL elements using the ''list'' keyword%0a* etc.%0a%0a->An example of applying scope to an LI element is below. For more information refer to [[PmWiki/WikiStyles#Scope | WikiStyle scope]].%0a(:markup class=horiz:) %0a* %25apply=item red%25Here is a red styled list item%0a* This item would not be styled.%0a(:markupend:)%0a%0a->You can [[PmWiki.WikiStyles#WikiStyleApply | add additional HTML elements to $WikiStyleApply]] to apply wiki styles to other HTML elements. For example to allow styling on table rows, or anchor tags.%0a%0a:$WikiPageCSSFmt: This variable holds a page name where you can add CSS rules applied to specific page patterns (default disabled). See Cookbook:LocalCSS as an example.%0a: : %25hlt php%25@@$WikiPageCSSFmt = 'Site.LocalCSS'; # global Site.LocalCSS page@@%0a: : %25hlt php%25@@$WikiPageCSSFmt = '[={$Group}=].LocalCSS'; # per-group LocalCSS pages@@%0a%0a:$WikiPageCSSVars: If a "wiki CSS page" is enabled with $WikiPageCSSFmt, this is an array with global PHP $variables available as pre-processor @variables in that page. By default the array contains: @@'FarmPubDirUrl', 'PubDirUrl', 'Skin', 'action', 'SkinDirUrl'@@.%0a%0a:$EnableSelfWikiPageCSS: If a "wiki CSS page" is enabled with $WikiPageCSSFmt, that specific page doesn't have CSS applied to itself when browsed or edited. In case a grave mistake is made in the styles and the site becomes unusable, this page will still be viewable and editable. People familiar with CSS can set this to 1 and the styles will be applied to the page itself, also in "Preview" mode:%0a: : %25hlt php%25@@$EnableSelfWikiPageCSS = 1; # Apply styles to the "wiki CSS page" itself@@%0a%0a:$PmTOC: Enable and configure the built-in table of contents, see [[Table of contents]] (TOC).%0a: : %25hlt php%25@@$PmTOC['Enable'] = 1; # Enable TOC; default is 0 (disabled).@@%0a%0a:$ToggleNextSelector: A CSS selector to enable interactive toggling of hidden sections, see Cookbook:ToggleNext. By default it is disabled.%0a%0a:$MaxIncludes:Controls the number of times that pages can be included via the %25pmhlt%25[@(:include:)@] and other directives, used to control recursion and otherwise pose a sanity check on page contents. $MaxIncludes defaults to 50, but can be set to any value by the wiki administrator.%0a--> %25hlt php%25[@$MaxIncludes = 50; # default%0a$MaxIncludes = 1000; # allow lots of includes%0a$MaxIncludes = 0; # turn off includes @]%0a%0a:$Skin:Lists the name(s) of skins to load, unless overridden by $ActionSkin. Normally $Skin contains a single string which is the name of a skin directory, but it may also be an array of names, in which case the first skin found from the list is used.%0a%0a:$SkinDirUrl:Set by ''@@scripts/skins.php@@'' to be the base url of the current skin's directory (i.e., within a '@@pub/skins/@@' directory). This variable is typically used inside of a skin @@.tmpl@@ file to provide access to @@.css@@ files and graphic images associated with the skin.%0a%0a:$SkinLibDirs:An array which, given the filesystem path (array key) to a skin (or a directory containing several skins), provides the corresponding URL (array value).%0a%0a->The array key is the directory containing the @@skin.tmpl@@ and @@skin.php@@ files, as seen by the PmWiki program. It does not have to be publicly accessible.%0a%0a-> The value is the URL (web address) of the directory containing the @@.css@@, @@.gif@@, and other files which appear in the HTML code sent by PMWiki to the browser. This directory must be publicly accessible.%0a%0a->By default $SkinLibDirs is set to:%0a--> %25hlt php%25[@%0a$SkinLibDirs = array(%0a "./pub/skins/\$Skin" => "$PubDirUrl/skins/\$Skin",%0a "$FarmD/pub/skins/\$Skin" => "$FarmPubDirUrl/skins/\$Skin");%0a@]%0a%0a->Extra details: When PMWiki is searching for a skin it looks for a directory named for the skin in the array index/keys, and if it finds it then it will use the files in that directory and also the files in the matching array value url. The two sides normally point to the same publicly accessible directory, but they do not have to.%0a%0a:$SkinTemplateIncludeLevel: how many levels of inclusion are allowed for [[skin templates]] with the %25hlt html%25[@%3c!--IncludeTemplate:...-->@]%25%25 directive. By default this directive is disabled. Setting it to 1 allows one level of inclusions, setting it to 2 allows included templates to include more templates. There can be up to 10 levels of inclusion. This variable can be defined either in @@local/config.php@@ or in @@pub/skins/skinname/skinname.php@@ (with SDV):%25hlt php%25[@%0a # in config.php, allow one level of inclusions%0a $SkinTemplateIncludeLevel = 1; %0a%0a # in skinname.php, allow 3 levels of inclusions%0a SDV($GLOBALS['SkinTemplateIncludeLevel'], 3); %0a@]%0a%0a:$PageLogoUrl: is the url that refers to a logo image which most skins display somewhere in the page's header (top left usually), e.g. "{$PageLogoUrl}"%0a%0a:$EnablePathInfo:Changes the handling of the page URL. When set to @@1@@ page URL will be @@...wiki.php/Main/Main@@, when set to @@0@@ (default) it will be @@...wiki.php?n=Main.Main@@.%0a%0a:$EnableFixedUrlRedirect:When PmWiki is given a partial page name (e.g., just the name of a WikiGroup), it uses $PagePathFmt in order to make a complete page name from the partial one, then issues a "redirect" to the browser to tell it to reload the page with the correct full page name. Setting %25hlt php%25@@$EnableFixedUrlRedirect=0;@@ blocks the redirect, so that PmWiki continues processing with the adjusted page name rather than issuing the redirect. %0a%0a:$GroupHeaderFmt:Defines the markup placed at the top of every page. Default value is:%0a [=$GroupHeaderFmt = '(:include {$Group}.GroupHeader self=0 basepage={*$FullName}:)(:nl:)';=]%0a%0a:$GroupPrintHeaderFmt:Defines the markup placed at the top of every page when [@action=print@]. Default value is:%0a [=SDV($GroupPrintHeaderFmt,'(:include $Group.GroupPrintHeader basepage={*$FullName}:)(:nl:)');=]%0a%0a:$GroupFooterFmt:Defines the markup placed at the bottom of every page. Default value is:%0a [=$GroupFooterFmt = '(:nl:)(:include {$Group}.GroupFooter self=0 basepage={*$FullName}:)';=]%0a%0a:$GroupPrintFooterFmt:Defines the markup placed at the bottom of every page when [@action=print@]. Default value is:%0a [=SDV($GroupPrintFooterFmt,'(:nl:)(:include $Group.GroupPrintFooter basepage={*$FullName}:)');=]%0a%0a:$PageNotFoundHeaderFmt:Specifies the HTTP header to send when attempting to browse a page that doesn't exist. Some webserver packages (notably Microsoft's "Personal Web Server") require that this variable be changed in order to work.%0a%0a-->%25hlt php%25[@%0a# default%0a$PageNotFoundHeaderFmt = 'HTTP/1.1 404 Not Found';%0a# return all pages as found%0a$PageNotFoundHeaderFmt = 'HTTP/1.1 200 Ok';%0a@]%0a%0a->Beware when expecting to return the content of a Group(header|footer) for an non existent page! By default PmWiki returns 404 (because the page does not exist), despite there is some content to show. Firefox shows the content, while Internet Explorer displays its default 404 page. $PageNotFoundHeaderFmt MUST be set to return 200 as described above in order to get the expected behaviour with all browsers.%0a%0a:$HTMLVSpace:Setting %25hlt php%25[@$HTMLVSpace = '';@]%25%25 in a local customizationfile (e.g., [@local/config.php@]) prevents insertion of spacer paragraphs (%25hlt html%25[@%3cp class='vspace'>%3c/p>@]%25%25) in generated HTML code. To limit this change to a single skin, place the %25hlt php%25[@$HTMLVSpace = '';@] statement in a @@skin.php@@ file, preceded by the statement %25hlt php%25[@global $HTMLVSpace;@].%0a%0a:$HTMLPNewline:This variable allows to enable linebreaks by default, i.e. without having the directive %25pmhlt%25[@(:linebreaks:)@] in a page or in a GroupHeader. To enable line breaks, add to @@config.php@@ such a line:\\%0a %25hlt php%25@@$HTMLPNewline = '%3cbr/>'; @@%0a%0a:$SimpleTableDefaultClassName:This variable can contain a CSS classname to be used for [[tables|simple tables]], if a "class=" attribute is not defined in the wiki page (default unset):\\%0a%25hlt php%25@@ $SimpleTableDefaultClassName = "wikisimpletable";@@\\%0aSee for sample code PITS:00638.%0a%0a:$EnableSimpleTableRowspan:If set to 1, will enable features replicating the recipe Cookbook:RowspanInSimpleTables (default disabled).\\%0a@@ $EnableSimpleTableRowspan = 1; @@ # See [[Cookbook:RowspanInSimpleTables|recipe]]%0a%0a:$EnableSortable:Set this variable to 1 to enable sortable tables, see [[Tables#sortable]] (default disabled):%25hlt php%25[@%0a$EnableSortable = 1; # Enable sortable tables@]%0a%0a:$TableCellAttrFmt:For [[Tables]], defines the HTML attributes given to each @@%3ctd>@@ or @@%3cth>@@ cell in the output. Can contain references to $TableCellCount which holds the horizontal column number of the current cell.%0a%0a:$TableCellAlignFmt:For [[Tables]], defines the HTML attributes for alignment of each @@%3ctd>@@ or @@%3cth>@@ cell. Default is @@" align='%25s'"@@ where %25s will be replaced with 'center', 'left' or 'right'. For a valid HTML5 output you may want to change this in @@config.php@@:\\%0a%25hlt php%25@@$TableCellAlignFmt = " class='%25s'";@@\\%0athen define the CSS classes td.center, td.right and td.left (also th).%0a%0a:$TableRowAttrFmt:For [[Tables]], defines the HTML attributes given to each @@%3ctr>@@ element in the output. Can contain references to $TableRowCount to give the absolute row number within the table, or $TableRowIndex to provide a repeating row index from 1 to $TableRowIndexMax.%0a-> %25hlt php%25[@# Give each row a unique CSS class based on row number (tr1, tr2, tr3, ... )%0a$TableRowAttrFmt = "class='tr\$TableRowCount'";%0a# Give each row alternating CSS classes (ti1, ti2, ti1, ti2, ti1, ... )%0a$TableRowIndexMax = 2;%0a$TableRowAttrFmt = "class='ti\$TableRowIndex'"; @]%0a%0a:$TableRowIndexMax:The maximum value for $TableRowIndex in [[Tables]].%0a-> %25hlt php%25[@# Set rows indexes as 1, 2, 3, 1, 2, 3, 1, 2, ...%0a$TableRowIndexMax = 3; @]%0a%0a:$EnableTableAutoValignTop:[[TableDirectives|Advanced tables]] are intended for layout, and automatically insert the @@valign='top'@@ attribute if there is no @@valign@@ attribute defined in the markup source. Setting this variable to 0 in config.php will prevent the automatic addition.%0a-> %25hlt php%25@@$EnableTableAutoValignTop = 0; # disable automatic valign='top' attr@@%0a%0a:$EnableAutoSkinList:This variable enables the change of the [[PmWiki/skins|skin]] from the URL to any skin available on the wiki installation. See also $PageSkinList and Skins:SkinChange.%0a%0a:$PageSkinList:This is an array of allowed skins that can be changed by the visitor with @@?skin=@@ or @@?setskin=@@ URL query to the wiki. See also $EnableAutoSkinList and Skins:SkinChange.%0a%0a:$TrailFmt: An array of HTML snippets containing the layout of the [[WikiTrails]] output. If you define one or more custom values in config.php, they will be used. Here are the default values:\\%0a%25hlt php%25[@%0a$TrailFmt['%3c%3c|'] = "%3cspan class='wikitrail'><< \$prev | \$trailname | \$next >>%3c/span>";%0a$TrailFmt['%3c|'] = "%3cspan class='wikitrail'>\$prev\$trailname\$next%3c/span>";%0a$TrailFmt['^|'] = "%3cspan class='wikitrail'>\$crumbs%3c/span>";%0a@]%0a%0a:$TrailPathSep: the trail separator of the "path" trail ( %25pmhlt%25[@^|[[TrailIndexPage]]|^@] ). For instance @@$TrailPathSep = ' > ';@@ will output "[=TrailIndexPage > TrailPage2 > TrailPage4=]".%0a%0a:$InputLabelFmt: A HTML snippet containing the layout of the "label" after an input form field. If you define a custom value in config.php, it will be used. The default value has initial and trailing spaces: \\%0a%25hlt php%25[@$InputLabelFmt = ' %3clabel for="$LabelFor" $LabelTitle>$LabelText%3c/label> '; @]%0a%0a:$FmtV['$TableCellCount']:PMWiki internal variable - Horizontal column number of the current cell. For use in $TableCellAttrFmt and $TableRowAttrFmt. Administrators can use in $TableCellAttrFmt and/or $TableRowAttrFmt.%0a-> Example: %25hlt php%25@@$TableCellAttrFmt = 'class=col\$TableCellCount';@@ %0a%0a:$FmtV['$TableRowCount']:PMWiki internal variable - Current row number. Administrators can use in $TableCellAttrFmt and/or $TableRowAttrFmt.%0a-> Example: %25hlt php%25@@TableRowAttrFmt = "class='row\$TableRowCount'";@@%0a%0a:$FmtV['$TableRowIndex']:PMWiki internal variable - Row index number derived from $TableRowIndexMax. (1,2,3,1,2,3,...). Administrators can use in $TableCellAttrFmt and/or $TableRowAttrFmt.%0a-> Example: %25hlt php%25@@$TableRowAttrFmt = "class='ind\$TableRowIndex'";@@%0a%0aSee also: [[Edit Variables]]%0a -time=1720327143 +text=(:Summary:variables that control page layout:)%0aVariable substitutions in the skin template are all managed by the %25hlt php%25@@`FmtPageName()@@ %25%25function from @@pmwiki.php@@. Pmwiki variable substitutions available on pages are managed by the {$var} substitutions from @@stdmarkup.php@@ or superseded in @@local/config@@ files. %0a%0a:$ActionSkin:This array is used to override the current skin when performing a given action. The most common use is to set %25hlt php%25@@$ActionSkin['print']='foo'@@ to use the 'foo' skin when printing, regardless of what the @@$Skin@@ variable is set to.%0a%0a:$ActionTitleFmt: An array that adds a separator and the current [[PmWiki:AvailableActions|wiki action]] ('edit', 'attr', 'diff', 'upload'...) to the HTML title of the page (the $ActionTitle variable in $HTMLTitleFmt or the skin template). By default it is localized [@"| action"@], but you can change it:%0a: : %25hlt php%25[@$ActionTitleFmt['edit'] = ': $[Edit]';@] # use a ":" colon separator%0a: : %25hlt php%25[@$ActionTitleFmt['edit'] = ' $[Edit] ';@] # space separator, may be placed at the start of $HTMLTitleFmt%0a%0a:$WikiTitle:A variable which contains the Wiki title as displayed in the browser tab and at the top of the browser window, e.g. "{$WikiTitle}"%0a%0a:$HTMLTitleFmt:A variable that overrides the content of the %25hlt html%25[@%3ctitle>...%3c/title>@]%25%25 element in the skin template. Here you can set this format without editing the skin template. For example:%0a: : %25hlt php%25@@$HTMLTitleFmt = '$Title | $WikiTitle $ActionTitle';@@ # Page title first, then $WikiTitle, then the action e.g. "| Edit", and the wiki group $Group is omitted.%0a: : %25hlt php%25@@$HTMLTitleFmt = '$Title | $GroupHomePageTitle';@@ # Page title first, then the title of the group landing page, see [[PageVariables]].%0a%0a:$EnablePageTitlePriority:A variable defining how to treat multiple %25pmhlt%25[@(:title ...:)@] [[page directives]] (added in PmWiki 2.2.9).%0a: : %25hlt php%25@@$EnablePageTitlePriority = 0;@@ # PmWiki default, last encountered title wins (the title may be changed from included pages or GroupFooter).%0a: : %25hlt php%25@@$EnablePageTitlePriority = 1;@@ # First title wins; if a title is defined in the page, directives from included pages cannot change it.%0a%0a:$EnableDiffInline:If set to 0, this variable switches off the word-level highlighting on the markup in the [[page history]].%0a: : %25hlt php%25@@$EnableDiffInline = 0;@@ # Disable colors, show plain text differences%0a%0a:$EnableRCDiffBytes:If set to 1, @@(All)RecentChanges@@ pages will display the difference in bytes of the page content from the previous version like %25diffmarkup%25{+(+123)+} or {-(-42)-}%25%25%0a: : %25hlt php%25@@$EnableRCDiffBytes = 1;@@ # Show bytes difference from previous version%0a%0a: : The colors are the same as those in the page history; if your skin doesn't provide them, add to ''@@pub/css/local.css@@'' something like: %25hlt css%25[@%0a.diffmarkup { font-family: monospace; font-size: 0.9em; } %0a.diffmarkup del { background: #ff9; text-decoration: none; }%0a.diffmarkup ins { background: #9f9; text-decoration: none; }@]%0a%0a:$CurrentTime: This variable contains the current date and time formatted with $TimeFmt. It is used in @@RecentChanges@@ (before 2.3.0), and in user signatures.%0a%0a:$CurrentLocalTime: This variable contains the current date and time stamp, saved in @@RecentChanges@@ (since 2.3.0). This time stamp will be saved in the wiki source text in Greenwich Mean Time (UTC/GMT), but will be shown according to $TimeFmt in the timezone of the wiki. When $EnableLocalTimes is enabled, then it will be shown in the visitor's time zone. The same format is also saved in user signatures if $EnableLocalTimes is enabled.%0a%0a:$EnablePmUtils: This variable controls whether the script @@pub/pmwiki-utils.js@@ should be loaded or not. The script contains JavaScript utility functions for the table of contents, the syntax highlighting, the recent changes, and the email obfuscation, and the dark color theme. By default $EnablePmUtils is 1 (enabled), but most functions need to be enabled individually ($EnableLocalTimes, $EnableHighlight, $PmTOC, $LinkFunctions['mailto:'], $EnableCopyCode, $EnableSortable, $ToggleNextSelector, $EnablePmSyntax, $CustomSyntax, $EnableCopyCode, $EnableDarkThemeToggle). Set this variable to 0 to disable all these functions.%0a%0a:$EnableDarkThemeToggle: This variable enables the core functions for toggling a dark color scheme, if the skin supports this feature, see Cookbook:DarkColorScheme. Can be set in a skin.php file (as global variable) or in config.php:%0a: : %25hlt php%25@@ $EnableDarkThemeToggle = 0; @@ dark theme toggling is disabled, even if the skin supports it%0a: : %25hlt php%25@@ $EnableDarkThemeToggle = 1; @@ dark theme toggling is enabled, with light theme by default%0a: : %25hlt php%25@@ $EnableDarkThemeToggle = 2; @@ dark theme toggling is enabled, with dark theme by default%0a: : %25hlt php%25@@ $EnableDarkThemeToggle = 3; @@ use automatically the theme preferred by the browser%0a: : See also $ImgDarkSuffix.%0a%0a:$EnableLocalTimes: (Default disabled) Enables the rewriting of date and time stamps into the timezone of the visitor, see documentation at Cookbook:LocalTimes. Dates affected are in RecentChanges pages, in page histories, and in user signatures.%0a: : %25hlt php%25@@ $EnableLocalTimes = 2; @@ Enables '''long''' local times, as in MM/DD/YYYY HH:MM:SS.%0a: : %25hlt php%25@@ $EnableLocalTimes = 1; @@ Enables '''compact''' local times, either HH:MM (within 24 hours), MM/DD or DD/MM (within 11 months), and MM/DD/YYYY or DD/MM/YYYY if earlier than 11 months. The long format appears in a tooltip title when the mouse is over the short format.%0a: : %25hlt php%25@@ $EnableLocalTimes = 3; @@ Like the '''compact''' local times, but when the date is earlier than 11 months, shows MM'YY.%0a%0a:$EnablePmSyntax: (Not to be confused with $EnableHighlight) When set to 1, enables [[Cookbook:PmSyntax|PmSyntax]], a syntax highlighting for the PmWiki markup language, which makes the documentation easy to read (from 2.3.0). When set to 2, it also enables the experimental syntax highlighting in the basic edit form: %25hlt php%25[@%0a$EnablePmSyntax = 1; # highlight documentation blocks%0a$EnablePmSyntax = 2; # both documentation and edit form%0aif ($action=='edit') $EnablePmSyntax = 2; # only edit form@]%0a%0a:$CustomSyntax:(From 2.3.0) An array where custom rules for syntax highlighting can be defined. See documentation at Cookbook:CustomSyntax.%0a%0a:$EnableHighlight: (Not to be confused with $EnablePmSyntax) If set to 1, enables compatibility with the [[https://github.com/highlightjs/highlight.js|highlight.js]] library to highlight program code. In addition, you need to include the library and mark your code blocks with the wikistyle [@%25highlight%25@], see [[WikiStyles#highlight]].%0a%0a:$EnableCopyCode: (From 2.3.21) When set to 1, adds a [@[+]@] button near the top right of preformatted blocks. A user clicking on the button will have the text of the preformatted block copied to their system clipboard: %25hlt php%25[@%0a$EnableCopyCode = 1; # add a [+] copy code button to pre blocks@]%0a%0a:$HTMLTagAttr:A string containing attributes of the %25hlt html%25@@%3chtml...>@@ tag in the skin template, default empty. For example, to add a "lang" attribute, set in @@config.php@@: %25hlt php%25[@%0a$HTMLTagAttr = 'lang="en" xml:lang="en"';@]%0a: : For this variable to work in a custom skin, add it in the template file, for example:%25hlt html%25[@%0a%3chtml xmlns="http://www.w3.org/1999/xhtml" $HTMLTagAttr>@]%0a%0a:$HTMLStylesFmt:An array of CSS statements to be included in the page's output along with other HTML headers. This array provides an easy place for scripts to add custom CSS statements.%0a%0a:$HTMLHeaderFmt:An array of HTML text to be included in the page's %25hlt html%25@@%3chead>@@ section, at the point where the [[skin template(s)]] specifies a [@%3c!--HTMLHeader-->@] directive. This array provides an easy place for scripts to add custom HTML headers.%0a%0a->For example, if you want to specify a [[Wikipedia:Favicon|favicon]] for all the pages of your wiki (a png image for Firefox (and others...), an ico for Internet Explorer):%0a-->%25hlt php%25[@%0a$HTMLHeaderFmt['favicon'] =%0a'%3clink href="http://path/to/icon.png" type="image/png" rel="icon" />%0a %3clink href="http://path/to/icon.ico" type="image/x-icon" rel="shortcut icon" />';%0a@]%0a%0a->Another example, if you want to get the RSS notification on some browsers (the RSS icon in Firefox for instance):%0a-->%25hlt php%25[@%0a$HTMLHeaderFmt['rss'] =%0a'%3clink rel="alternate" type="application/rss+xml" title="Rss All recent Changes" %0a href="$ScriptUrl/Site/AllRecentChanges?action=rss" />';%0a@]%0a%0a->Javascript example%0a-->%25hlt php%25[@%0a$HTMLHeaderFmt['the-javascript'] =%0a'%3cscript>%0a // the javascript code%0a %3c/script>';@]%0a%0a:$HTMLFooterFmt:Like $HTMLHeaderFmt above, this contains an array of HTML text to be included near the end of an HTML document, at the point where the [[skin template(s)]] specifies a %25hlt php%25[@%3c!--HTMLFooter-->@] directive (usually just before a closing @@%3c/body>@@ tag). Primarily used by scripts to add custom HTML output after the body of the page output. %0a%0a:$MetaRobots:Sets the value of the %25hlt php%25[@%3cmeta name='robots' ... />@] tag generated by PmWiki to control search engine robots accessing the site. PmWiki's default setting tells robots to not index anything but the normal page view, and to not index pages in the PmWiki [[wiki group]]. Explicitly setting $MetaRobots overrides this default.%0a--> %25hlt php%25[@# never index this site%0a$MetaRobots = 'noindex,nofollow';%0a# disable the robots tag entirely%0a$MetaRobots = ''; @]%0a%0a:$MessagesFmt:An array of HTML text to be displayed at the point of any %25pmhlt%25[@(:messages:)@] markup. Commonly used for displaying messages with respect to editing pages.%0a%0a:$RecentChangesFmt:An array specifying the format of the RecentChanges listing.%0a%0a->The key of the array specifies the page where changes will be logged, as in%0a-->%25hlt php%25[@%0a$RecentChangesFmt['$SiteGroup.AllRecentChanges']%0a@]%0a->The value of the array specifies the format in which the changes will be logged, as in%0a-->%25pmhlt%25[@%0a'* [[{$Group}.{$Name}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]'%0a@]%0a->Note the two consecutive spaces before the three dots (@@. . .@@). The two spaces separate two parts of the format: the first part doesn't change (e.g. a link to the changed page) and the second part does change (e.g. the date and author of the change). Upon saving a page, PmWiki removes a line that matches the first part and adds a line with the current format before the first line with 2 spaces. This way, any line without two consecutive spaces stays at the top of the recent changes page.%0a%0a->You can use and adapt the following to change the format (put it in config.php):%0a-->%25hlt php%25[@%0a$RecentChangesFmt['$SiteGroup.AllRecentChanges'] = %0a '* [[{$Group}.{$Name}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]';%0a$RecentChangesFmt['$Group.RecentChanges'] =%0a '* [[{$Group}/{$Name}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]';%0a@]%0a-> Since PmWiki 2.3.0, the format uses $CurrentLocalTime by default which shows exactly what $CurrentTime previously showed, but when $EnableLocalTimes is set, will rewrite the time and date in the local format and timezone of the visitor. %0a%0a->Note that changes made to the format will only affect new edits. In other words, you will need to edit a page for your new format to be visible. Note also that you need to have two spaces between the page name and the other information about the edit.%0a%0a->Also note that this variable has other uses, such as not reporting at all to RecentChanges and AllRecentChanges as found here [[PmWiki:Questions|PmWiki Questions]]. More informations on customizing RecentChanges pages here : [[Cookbook/CustomRecentChanges]].%0a%0a:$RecentUploadsFmt:An array specifying the format for uploaded files at the RecentChanges listing. It is similar to $RecentChangesFmt. If enabled, newly uploaded files will be logged to the RecentChanges pages. Default is disabled. See Cookbook:RecentUploadsLog for more information. See also $EnableRecentUploads.%0a%0a:$EnableRecentUploads: When set to 1, and when $RecentUploadsFmt is not set, it enables Recent uploads in a default format, only on the page Site.AllRecentChanges. This was added in 2.3.0 to easily enable the feature with some default settings that may be good enough for many wikis.%0a%0a:$DraftRecentChangesFmt:An array specifying the format of the RecentChanges listing when saving Draft pages.%0a%0a->$RecentChangesFmt is set to $DraftRecentChangesFmt when a Draft page is saved. For example, you could save drafts in a separate Recent Draft Changes page and not list in the normal group's Recent Changes page:%0a-->%25hlt php%25[@%0a$DraftRecentChangesFmt['$Group.RecentDraftChanges'] =%0a '* [[{$Group}/{$Name}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]';%0a$DraftRecentChangesFmt['$Group.RecentChanges'] = '';%0a@]%0a%0a:$RCLinesMax:The maximum number of lines to be stored in RecentChanges pages. The default is zero, meaning "no limit".%0a $RCLinesMax = 1000; # maintain at most 1000 recent changes%0a%0a:$PageRedirectFmt:The text to be used when a page is redirected via the [@(:redirect:)@] markup.%0a-->%25hlt php%25[@%0a$PageRedirectFmt = '%3cp>%3ci>redirected from $FullName%3c/p>';%0a$PageRedirectFmt = '';%0a@]%0a->For display options, see also the FAQ on [[(PmWiki:)PageDirectives(#faq)]].%0a%0a:$WikiStyle:An array which contains the predefined WikiStyles which can be used on a textpage.[[%3c%3c]]See: [[PmWiki.CustomWikiStyles]]%0a%0a:$WikiStyleApply:An array which defines the scope of wiki styling per HTML element. Default settings are:%0a->%25hlt php%25[@%0a'item' => 'li|dt',%0a'list' => 'ul|ol|dl',%0a'div' => 'div',%0a'pre' => 'pre',%0a'img' => 'img',%0a'block' => 'p(?!\\sclass=)|div|ul|ol|dl|li|dt|pre|h[1-6]',%0a'p' => 'p(?!\\sclass=)'%0a@]%0a%0a->This defines that we can apply wiki styling on:%0a* LI elements using the ''item'' keyword%0a* UL, OL, DL elements using the ''list'' keyword%0a* etc.%0a%0a->An example of applying scope to an LI element is below. For more information refer to [[PmWiki/WikiStyles#Scope | WikiStyle scope]].%0a(:markup class=horiz:) %0a* %25apply=item red%25Here is a red styled list item%0a* This item would not be styled.%0a(:markupend:)%0a%0a->You can [[PmWiki.WikiStyles#WikiStyleApply | add additional HTML elements to $WikiStyleApply]] to apply wiki styles to other HTML elements. For example to allow styling on table rows, or anchor tags.%0a%0a:$WikiPageCSSFmt: This variable holds a page name where you can add CSS rules applied to specific page patterns (default disabled). See Cookbook:LocalCSS as an example.%0a: : %25hlt php%25@@$WikiPageCSSFmt = 'Site.LocalCSS'; # global Site.LocalCSS page@@%0a: : %25hlt php%25@@$WikiPageCSSFmt = '[={$Group}=].LocalCSS'; # per-group LocalCSS pages@@%0a%0a:$WikiPageCSSVars: If a "wiki CSS page" is enabled with $WikiPageCSSFmt, this is an array with global PHP $variables available as pre-processor @variables in that page. By default the array contains: @@'FarmPubDirUrl', 'PubDirUrl', 'Skin', 'action', 'SkinDirUrl'@@.%0a%0a:$EnableSelfWikiPageCSS: If a "wiki CSS page" is enabled with $WikiPageCSSFmt, that specific page doesn't have CSS applied to itself when browsed or edited. In case a grave mistake is made in the styles and the site becomes unusable, this page will still be viewable and editable. People familiar with CSS can set this to 1 and the styles will be applied to the page itself, also in "Preview" mode:%0a: : %25hlt php%25@@$EnableSelfWikiPageCSS = 1; # Apply styles to the "wiki CSS page" itself@@%0a%0a:$PmTOC: Enable and configure the built-in table of contents, see [[Table of contents]] (TOC).%0a: : %25hlt php%25@@$PmTOC['Enable'] = 1; # Enable TOC; default is 0 (disabled).@@%0a%0a:$ToggleNextSelector: A CSS selector to enable interactive toggling of hidden sections, see Cookbook:ToggleNext. By default it is disabled.%0a%0a:$MaxIncludes:Controls the number of times that pages can be included via the %25pmhlt%25[@(:include:)@] and other directives, used to control recursion and otherwise pose a sanity check on page contents. $MaxIncludes defaults to 50, but can be set to any value by the wiki administrator.%0a--> %25hlt php%25[@$MaxIncludes = 50; # default%0a$MaxIncludes = 1000; # allow lots of includes%0a$MaxIncludes = 0; # turn off includes @]%0a%0a:$Skin:Lists the name(s) of skins to load, unless overridden by $ActionSkin. Normally $Skin contains a single string which is the name of a skin directory, but it may also be an array of names, in which case the first skin found from the list is used.%0a%0a:$SkinDirUrl:Set by ''@@scripts/skins.php@@'' to be the base url of the current skin's directory (i.e., within a '@@pub/skins/@@' directory). This variable is typically used inside of a skin @@.tmpl@@ file to provide access to @@.css@@ files and graphic images associated with the skin.%0a%0a:$SkinLibDirs:An array which, given the filesystem path (array key) to a skin (or a directory containing several skins), provides the corresponding URL (array value).%0a%0a->The array key is the directory containing the @@skin.tmpl@@ and @@skin.php@@ files, as seen by the PmWiki program. It does not have to be publicly accessible.%0a%0a-> The value is the URL (web address) of the directory containing the @@.css@@, @@.gif@@, and other files which appear in the HTML code sent by PMWiki to the browser. This directory must be publicly accessible.%0a%0a->By default $SkinLibDirs is set to:%0a--> %25hlt php%25[@%0a$SkinLibDirs = array(%0a "./pub/skins/\$Skin" => "$PubDirUrl/skins/\$Skin",%0a "$FarmD/pub/skins/\$Skin" => "$FarmPubDirUrl/skins/\$Skin");%0a@]%0a%0a->Extra details: When PMWiki is searching for a skin it looks for a directory named for the skin in the array index/keys, and if it finds it then it will use the files in that directory and also the files in the matching array value url. The two sides normally point to the same publicly accessible directory, but they do not have to.%0a%0a:$SkinTemplateIncludeLevel: how many levels of inclusion are allowed for [[skin templates]] with the %25hlt html%25[@%3c!--IncludeTemplate:...-->@]%25%25 directive. By default this directive is disabled. Setting it to 1 allows one level of inclusions, setting it to 2 allows included templates to include more templates. There can be up to 10 levels of inclusion. This variable can be defined either in @@local/config.php@@ or in @@pub/skins/skinname/skinname.php@@ (with SDV):%25hlt php%25[@%0a # in config.php, allow one level of inclusions%0a $SkinTemplateIncludeLevel = 1; %0a%0a # in skinname.php, allow 3 levels of inclusions%0a SDV($GLOBALS['SkinTemplateIncludeLevel'], 3); %0a@]%0a%0a:$PageLogoUrl: is the url that refers to a logo image which most skins display somewhere in the page's header (top left usually), e.g. "{$PageLogoUrl}"%0a%0a:$EnablePathInfo:Changes the handling of the page URL. When set to @@1@@ page URL will be @@...wiki.php/Main/Main@@, when set to @@0@@ (default) it will be @@...wiki.php?n=Main.Main@@.%0a%0a:$EnableFixedUrlRedirect:When PmWiki is given a partial page name (e.g., just the name of a WikiGroup), it uses $PagePathFmt in order to make a complete page name from the partial one, then issues a "redirect" to the browser to tell it to reload the page with the correct full page name. Setting %25hlt php%25@@$EnableFixedUrlRedirect=0;@@ blocks the redirect, so that PmWiki continues processing with the adjusted page name rather than issuing the redirect. %0a%0a:$GroupHeaderFmt:Defines the markup placed at the top of every page. Default value is:%0a [=$GroupHeaderFmt = '(:include {$Group}.GroupHeader self=0 basepage={*$FullName}:)(:nl:)';=]%0a%0a:$GroupPrintHeaderFmt:Defines the markup placed at the top of every page when [@action=print@]. Default value is:%0a [=SDV($GroupPrintHeaderFmt,'(:include $Group.GroupPrintHeader basepage={*$FullName}:)(:nl:)');=]%0a%0a:$GroupFooterFmt:Defines the markup placed at the bottom of every page. Default value is:%0a [=$GroupFooterFmt = '(:nl:)(:include {$Group}.GroupFooter self=0 basepage={*$FullName}:)';=]%0a%0a:$GroupPrintFooterFmt:Defines the markup placed at the bottom of every page when [@action=print@]. Default value is:%0a [=SDV($GroupPrintFooterFmt,'(:nl:)(:include $Group.GroupPrintFooter basepage={*$FullName}:)');=]%0a%0a:$PageNotFoundHeaderFmt:Specifies the HTTP header to send when attempting to browse a page that doesn't exist. Some webserver packages (notably Microsoft's "Personal Web Server") require that this variable be changed in order to work.%0a%0a-->%25hlt php%25[@%0a# default%0a$PageNotFoundHeaderFmt = 'HTTP/1.1 404 Not Found';%0a# return all pages as found%0a$PageNotFoundHeaderFmt = 'HTTP/1.1 200 Ok';%0a@]%0a%0a->Beware when expecting to return the content of a Group(header|footer) for an non existent page! By default PmWiki returns 404 (because the page does not exist), despite there is some content to show. Firefox shows the content, while Internet Explorer displays its default 404 page. $PageNotFoundHeaderFmt MUST be set to return 200 as described above in order to get the expected behaviour with all browsers.%0a%0a:$HTMLVSpace:Setting %25hlt php%25[@$HTMLVSpace = '';@]%25%25 in a local customizationfile (e.g., [@local/config.php@]) prevents insertion of spacer paragraphs (%25hlt html%25[@%3cp class='vspace'>%3c/p>@]%25%25) in generated HTML code. To limit this change to a single skin, place the %25hlt php%25[@$HTMLVSpace = '';@] statement in a @@skin.php@@ file, preceded by the statement %25hlt php%25[@global $HTMLVSpace;@].%0a%0a:$HTMLPNewline:This variable allows to enable linebreaks by default, i.e. without having the directive %25pmhlt%25[@(:linebreaks:)@] in a page or in a GroupHeader. To enable line breaks, add to @@config.php@@ such a line:\\%0a %25hlt php%25@@$HTMLPNewline = '%3cbr/>'; @@%0a%0a:$SimpleTableDefaultClassName:This variable can contain a CSS classname to be used for [[tables|simple tables]], if a "class=" attribute is not defined in the wiki page (default unset):\\%0a%25hlt php%25@@ $SimpleTableDefaultClassName = "wikisimpletable";@@\\%0aSee for sample code PITS:00638.%0a%0a:$EnableSimpleTableRowspan:If set to 0, will disable features replicating the recipe Cookbook:RowspanInSimpleTables (default enabled since 2.3.37).\\%0a@@ $EnableSimpleTableRowspan = 0; @@ # disable table rowspan markup%0a%0a:$EnableSortable:Set this variable to 0 to disable sortable tables, see [[Tables#sortable]] (default enabled since 2.3.37):\\%0a%25hlt php%25[@$EnableSortable = 0; # Disable sortable tables@]%0a%0a:$TableCellAttrFmt:For [[Tables]], defines the HTML attributes given to each @@%3ctd>@@ or @@%3cth>@@ cell in the output. Can contain references to $TableCellCount which holds the horizontal column number of the current cell.%0a%0a:$TableCellAlignFmt:For [[Tables]], defines the HTML attributes for alignment of each @@%3ctd>@@ or @@%3cth>@@ cell. Default is @@" align='%25s'"@@ where %25s will be replaced with 'center', 'left' or 'right'. For a valid HTML5 output you may want to change this in @@config.php@@:\\%0a%25hlt php%25@@$TableCellAlignFmt = " class='%25s'";@@\\%0athen define the CSS classes td.center, td.right and td.left (also th).%0a%0a:$TableRowAttrFmt:For [[Tables]], defines the HTML attributes given to each @@%3ctr>@@ element in the output. Can contain references to $TableRowCount to give the absolute row number within the table, or $TableRowIndex to provide a repeating row index from 1 to $TableRowIndexMax.%0a-> %25hlt php%25[@# Give each row a unique CSS class based on row number (tr1, tr2, tr3, ... )%0a$TableRowAttrFmt = "class='tr\$TableRowCount'";%0a# Give each row alternating CSS classes (ti1, ti2, ti1, ti2, ti1, ... )%0a$TableRowIndexMax = 2;%0a$TableRowAttrFmt = "class='ti\$TableRowIndex'"; @]%0a%0a:$TableRowIndexMax:The maximum value for $TableRowIndex in [[Tables]].%0a-> %25hlt php%25[@# Set rows indexes as 1, 2, 3, 1, 2, 3, 1, 2, ...%0a$TableRowIndexMax = 3; @]%0a%0a:$EnableTableAutoValignTop:[[TableDirectives|Advanced tables]] are intended for layout, and automatically insert the @@valign='top'@@ attribute if there is no @@valign@@ attribute defined in the markup source. Setting this variable to 0 in config.php will prevent the automatic addition.%0a-> %25hlt php%25@@$EnableTableAutoValignTop = 0; # disable automatic valign='top' attr@@%0a%0a:$EnableAutoSkinList:This variable enables the change of the [[PmWiki/skins|skin]] from the URL to any skin available on the wiki installation. See also $PageSkinList and Skins:SkinChange.%0a%0a:$PageSkinList:This is an array of allowed skins that can be changed by the visitor with @@?skin=@@ or @@?setskin=@@ URL query to the wiki. See also $EnableAutoSkinList and Skins:SkinChange.%0a%0a:$TrailFmt: An array of HTML snippets containing the layout of the [[WikiTrails]] output. If you define one or more custom values in config.php, they will be used. Here are the default values:\\%0a%25hlt php%25[@%0a$TrailFmt['%3c%3c|'] = "%3cspan class='wikitrail'><< \$prev | \$trailname | \$next >>%3c/span>";%0a$TrailFmt['%3c|'] = "%3cspan class='wikitrail'>\$prev\$trailname\$next%3c/span>";%0a$TrailFmt['^|'] = "%3cspan class='wikitrail'>\$crumbs%3c/span>";%0a@]%0a%0a:$TrailPathSep: the trail separator of the "path" trail ( %25pmhlt%25[@^|[[TrailIndexPage]]|^@] ). For instance @@$TrailPathSep = ' > ';@@ will output "[=TrailIndexPage > TrailPage2 > TrailPage4=]".%0a%0a:$InputLabelFmt: A HTML snippet containing the layout of the "label" after an input form field. If you define a custom value in config.php, it will be used. The default value has initial and trailing spaces: \\%0a%25hlt php%25[@$InputLabelFmt = ' %3clabel for="$LabelFor" $LabelTitle>$LabelText%3c/label> '; @]%0a%0a:$FmtV['$TableCellCount']:PMWiki internal variable - Horizontal column number of the current cell. For use in $TableCellAttrFmt and $TableRowAttrFmt. Administrators can use in $TableCellAttrFmt and/or $TableRowAttrFmt.%0a-> Example: %25hlt php%25@@$TableCellAttrFmt = 'class=col\$TableCellCount';@@ %0a%0a:$FmtV['$TableRowCount']:PMWiki internal variable - Current row number. Administrators can use in $TableCellAttrFmt and/or $TableRowAttrFmt.%0a-> Example: %25hlt php%25@@TableRowAttrFmt = "class='row\$TableRowCount'";@@%0a%0a:$FmtV['$TableRowIndex']:PMWiki internal variable - Row index number derived from $TableRowIndexMax. (1,2,3,1,2,3,...). Administrators can use in $TableCellAttrFmt and/or $TableRowAttrFmt.%0a-> Example: %25hlt php%25@@$TableRowAttrFmt = "class='ind\$TableRowIndex'";@@%0a%0aSee also: [[Edit Variables]]%0a +time=1723976543 diff --git a/wikilib.d/PmWiki.Tables b/wikilib.d/PmWiki.Tables index fa8ca9bd..dde1cb2e 100644 --- a/wikilib.d/PmWiki.Tables +++ b/wikilib.d/PmWiki.Tables @@ -1,10 +1,10 @@ -version=pmwiki-2.3.30 ordered=1 urlencoded=1 +version=pmwiki-2.3.36 ordered=1 urlencoded=1 author=Petko charset=UTF-8 -csum=pmhlt (+69) +csum=rowspan (+729) ctime=1141945978 name=PmWiki.Tables -rev=114 +rev=116 targets=PmWiki.TableDirectives,Cookbook.RowspanInSimpleTables,Cookbook.FormattingTables,PmWiki.LayoutVariables,PmWiki.WikiStyles -text=(:Audience: authors (basic) :)%0a(:Summary:Simple tables with double pipe markup, one row per line:)%0a%0aPmWiki has two types of table markup; the markup described in this page is useful for creating ''simple'' tables with lots of small cells, while [[table directive markup->table directives]] helps with larger scale or more complex tables. For more possibilities with formatting simple tables, see [[Cookbook:Rowspan in simple tables]] and [[Cookbook:Formatting tables]].%0a%0a!! Table basics%0aSimple tables are created via use of double pipe characters: %25pmhlt%25@@||@@%25%25. Lines beginning with this markup denote rows in a table or a formatting line. Within table row lines the double-pipe is used to delimit cells. In the examples below a border is added for illustration (the default is no border).%0a%0aThe first line in the markup (initial double bars "%25pmhlt%25@@||@@%25%25") is required. After the double bars, there may be optional formatting commands for the table such as border or width.%0a%0a(:markup caption='Basic table' class=horiz:)%0a|| border=1%0a|| cell 1 || cell 2 || cell 3 ||%0a|| cell 1 || cell 2 ||%0a(:markupend:)%0a%0aHeader cells can be created by placing ! as the first character of a cell. Note that these are ''table headers'', not ''headings'', so it doesn't extend to !!, !!!, etc.%0a%0a(:markup caption='Table with borders and headers' class=horiz:)%0a|| border=1%0a||! cell 1 ||! cell 2 ||! cell 3 ||%0a|| cell 1 || cell 2 || cell 3 ||%0a(:markupend:)%0a%0aA table can have a caption, indicated by [@||!caption!||@]. Any caption must appear prior to other rows of the table.%0a%0a(:markup caption='Table caption' class=horiz:)%0a|| border=1%0a||! A special table !||%0a||! cell 1 ||! cell 2 ||! cell 3 ||%0a|| cell 1 || cell 2 || cell 3 ||%0a(:markupend:)%0a%0a%0a!! Formatting cell contents%0a%0aCell contents may be aligned left, centered, or aligned right. %0a* To left-align contents, place the cell contents next to the leading %25pmhlt%25@@||@@%25%25.%0a* To center contents, add a space before and after the cell contents.%0a* To right-align contents, place a space before the cell contents and leave the cell contents next to the trailing %25pmhlt%25@@||@@%25%25.%0a%0a(:markup caption='Cell alignments':)%0a|| border=1 width=100%25%0a||!cell 1 ||! cell 2 ||! cell 3||%0a||left-aligned || centered || right-aligned||%0a(:markupend:)%0a%0a(:markup caption='Default cell alignments':)%0a|| border=1 width=100%25%0a||!cell default||!cell left ||%0a||default-aligned||left-aligned ||%0a(:markupend:)%0a%0aNote that header and detail cells have different default alignments.%0a%0aTo get a cell to span multiple columns, follow the cell with empty cells.%0a(At present there is no markup for spanning rows.)%0a%0a(:markup caption='Column spanning':)%0a|| border=1 width=100%25%0a|| |||| right column ||%0a|| || right two columns ||||%0a|| || middle column || ||%0a|| left column || ||||%0a|| left two columns |||| ||%0a|| entire row ||||||%0a|| left column || middle column || right column ||%0a(:markupend:)%0a%0a!! Table attributes%0a%0aAny line that begins with %25pmhlt%25@@||@@%25%25 but doesn't have a closing %25pmhlt%25@@||@@%25%25 sets the ''table attributes'' for any tables that follow. These attributes can control the size and position of the table, borders, background color, and cell spacing. (In fact these are just standard HTML attributes that are placed in the %3ctable> tag.)%0a%0aUse the [@width=@] attribute to set a table's width, using either a percentage value, an absolute size, or '''*'''.%0a%0aSee also $SimpleTableDefaultClassName.%0a%0a(:markup caption='Table width':)%0a|| border=1 width=100%25 %0a|| cell 1 || cell 2 || cell 3 ||%0a|| c1 || cellcellcellcell2 || cell 3 ||%0a(:markupend:)%0a%0aThe [@border=@] attribute sets the size of a table's borders.%0a%0a(:markup caption='Bordered table' class=horiz:)%0a|| border=10 width=70%25%0a||!cell 1 ||! cell 2 ||! cell 3||%0a||left-aligned || centered || right-aligned||%0a(:markupend:)%0a%0a(:markup caption='Borderless table' class=horiz:)%0a|| border=0 width=70%25%0a||!cell 1 ||! cell 2 ||! cell 3||%0a||left-aligned || centered || right-aligned||%0a(:markupend:)%0a%0aUse [@align=center@], [@align=left@], and [@align=right@] to center, left, or right align a table. Note that [@align=left@] and [@align=right@] create a ''floating table'', such that text wraps around the table.%0a%0a(:markup caption='Table alignment: center':)%0a|| border=1 align=center width=50%25%0a||!cell 1 ||! cell 2 ||! cell 3||%0a||left-aligned || centered || right-aligned||%0aNotice how text does not wrap with a table using "align=center".%0a(:markupend:)%0a%0a(:markup caption='Table alignment: left':)%0a|| border=1 align=left width=50%25%0a||!cell 1 ||! cell 2 ||! cell 3||%0a||left-aligned || centered || right-aligned||%0aNotice how text wraps to the right of a table using "align=left".%0a(:markupend:)%0a%0a(:markup caption='Table alignment: right':)%0a|| border=1 align=right width=50%25%0a||!cell 1 ||! cell 2 ||! cell 3||%0a||left-aligned || centered || right-aligned||%0aNotice how text wraps to the left of a table using "align=right".%0a(:markupend:)%0a%0aNote: to get a table to align left (but not "float left") requires CSS, as in%0a->%25pmhlt%25[@||style="margin-left:0px;"@]%0a%0aThe [@bgcolor=@] attribute sets the background color for a table. At present there is no way to specify the color of individual rows or cells in this type of table (but see Cookbook:FormattingTables).%0a%0a(:markup class=horiz:)%0a|| border=1 align=center bgcolor=yellow width=70%25%0a||!cell 1 ||! cell 2 ||! cell 3||%0a||left-align || center || right-align||%0a(:markupend:)%0a%0a!! Sortable tables [[#sortable]]%0aTo allow readers to reorder a table, give it the class="sortable" attribute:%0a(:markup:)%0a|| class="sortable simpletable"%0a||! m||!Geographic zone ||!Highest point ||!Country ||%0a|| 3700||Arctic ||Gunnbjørn Fjeld ||Greenland ||%0a|| 8848||North Temperate Zone ||Mount Everest ||Nepal ||%0a|| 5790||North Tropical Zone ||Cayambe ||Ecuador ||%0a|| 6768||South Tropical Zone ||Huáscarán ||Peru ||%0a|| 6960||South Temperate Zone ||Aconcagua ||Argentina ||%0a|| 4892||Antarctic ||Mount Vinson ||(none) ||%0a(:markupend:)%0a%0aNotes:%0a* This feature has to be enabled in local configuration, see $EnableSortable. It will then work both for simple tables as above, and for [[table directives]] with the class="sortable" attribute.%0a* The optional "simpletable" class is available in core skins and possibly other skins, it should define reasonably simple table styles.%0a* The first row of the table needs to have heading cells with %25pmhlt%25 [@||!@]%25%25 separators which can be clicked to order the rows by the column.%0a* If the last row of your table should be a footer that is not sorted, use the class "sortable-footer" instead of "sortable". If you use %25pmhlt%25 [@||!@]%25%25 separators in the footer, they will also allow the rows to be sorted, like the header cells.%0a%0aData types: By default, the rows are sorted numerically, if the cells contain unformatted numeric values, or alphabetically. You can define the sorting data type of a column by adding to the heading cell an empty [[WikiStyle(s)]] element:%0a* %25pmhlt%25@@[=%25sort-numeric-us%25%25%25=]@@ - cells in the column contain US-formatted numbers like @@1,234.56@@.%0a* %25pmhlt%25@@[=%25sort-numeric%25%25%25=]@@ - cells in the column contain SI-formatted numbers like @@1 234,56@@.%0a* %25pmhlt%25@@[=%25sort-date%25%25%25=]@@ - cells in the column contain dates or date-times that will be parsed by the browser. Dates like "2023-11-19" or "2023-11-19 14:09:11" should be correctly parsed, other dates in English might be correctly detected or not.%0a* %25pmhlt%25@@[=%25sort-time%25%25%25=]@@ - the cell contains a %25hlt html%25@@%3ctime datetime="...">%3c/time>@@ element, and its "datetime" value should be used for sorting. Markup like %25pmhlt%25@@[=@2022-01-08T10:07:08Z=]@@ or @@[={(ftime "%25L" "{*$LastModifiedTime}")}=]@@ would output a %3ctime> element in the timezone of the visitor, with more or less precision depending on $EnableLocalTimes, but the "datetime" attributes should allow precise sorting.%0a%0a!! FAQ%0a>>faq%3c%3c [[#faq]]%0aQ: How do I create a basic table? %0aA: Tables are created via use of the double pipe character: @@||@@. Lines beginning with this markup denote rows in a table; within such lines the double-pipe is used to delimit cells. In the examples below a border is added for illustration (the default is no border).%0a%0a(:markup caption='Basic table' class=horiz:)%0a|| border=1 rules=rows frame=hsides%0a|| cell 1 || cell 2 || cell 3 ||%0a|| cell 1 || cell 2 || cell 3 ||%0a(:markupend:)%0a%0aQ: How do I create cell headers?%0aA: Header cells can be created by placing ! as the first character of a cell. Note that these are ''table headers'', not ''headings'', so it doesn't extend to !!, !!!, etc.%0a%0a(:markup caption='Table headers' class=horiz:)%0a|| border=1 rules=cols frame=vsides%0a||! cell 1 ||! cell 2 ||! cell 3 ||%0a|| cell 1 || cell 2 || cell 3 ||%0a(:markupend:)%0a%0aQ: How do I obtain a table with thin lines and more distance to the content?%0aA: "Thin lines" is tricky and browser dependent, but the following works for Firefox and IE (Nov. 2009):%0a%0a(:markup caption='Thin lines and cell padding' class=horiz:)%0a||border="1" style="border-collapse:collapse" cellpadding="5" width=66%25%0a||!Header ||! Header || '''Header'''||%0a||cells || with || padding||%0a|| || || ||%0a(:markupend:)%0a%0aQ: How do I create an advanced table? %0aA: See [[PmWiki.TableDirectives | table directives]]%0a%0aQ: My tables are by default centered. When I try to use '||align=left' they don't align left as expected. %0aA: Use ||style="margin-left:0px;" instead. %0a%0aQ: How can I specify the width of columns?%0aA: You can define the widths via custom styles, see Cookbook:FormattingTables and $TableCellAttrFmt. Add in config.php :%0a[@$TableCellAttrFmt = 'class=col$TableCellCount';@]%0a-> And add in pub/css/local.css : %0a[@%0atable.column td.col1 { width: 120px; }%0atable.column td.col3 { width: 40px; }%0a@]%0a%0aQ: How can I display a double pipe "||" in cell text using basic table markup?%0aA: Escape it with [@[=||=]@] to display || unchanged.%0a%0aQ: How do I apply styles to the elements of the table, like an ID to the table row, or a class/style to the TD?%0aA: See [[PmWiki/WikiStyles#WikiStyleApply | $WikiStyleApply]].%0a%0aAlternately, use [[table directives]], which allow specifying styling either directly (''style="..."'') or by a ''class="..."'' attribute for CSS.%0a%0aQ: Is there a simple way to change the table defaults? I prefer a border and I'm tired of adding it to every table.%0aA: You can set %25hlt php%25 @@$SimpleTableDefaultClassName = 'simpletable';@@ and/or define your own styles in your stylesheet. The "simpletable" class is available in the core skins, and can be redefined or overridden in pub/css/local.css.%0a -time=1706007521 +text=(:Audience: authors (basic) :)%0a(:Summary:Simple tables with double pipe markup, one row per line:)%0a%0aPmWiki has two types of table markup; the markup described in this page is useful for creating ''simple'' tables with lots of small cells, while [[table directive markup->table directives]] helps with larger scale or more complex tables. For more possibilities with formatting simple tables, see [[Cookbook:Rowspan in simple tables]] and [[Cookbook:Formatting tables]].%0a%0a!! Table basics%0aSimple tables are created via use of double pipe characters: %25pmhlt%25@@||@@%25%25. Lines beginning with this markup denote rows in a table or a formatting line. Within table row lines the double-pipe is used to delimit cells. In the examples below a border is added for illustration (the default is no border).%0a%0aThe first line in the markup (initial double bars "%25pmhlt%25@@||@@%25%25") is required. After the double bars, there may be optional formatting commands for the table such as border or width.%0a%0a(:markup caption='Basic table' class=horiz:)%0a|| border=1%0a|| cell 1 || cell 2 || cell 3 ||%0a|| cell 1 || cell 2 ||%0a(:markupend:)%0a%0aHeader cells can be created by placing ! as the first character of a cell. Note that these are ''table headers'', not ''headings'', so it doesn't extend to !!, !!!, etc.%0a%0a(:markup caption='Table with borders and headers' class=horiz:)%0a|| border=1%0a||! cell 1 ||! cell 2 ||! cell 3 ||%0a|| cell 1 || cell 2 || cell 3 ||%0a(:markupend:)%0a%0aA table can have a caption, indicated by [@||!caption!||@]. Any caption must appear prior to other rows of the table.%0a%0a(:markup caption='Table caption' class=horiz:)%0a|| border=1%0a||! A special table !||%0a||! cell 1 ||! cell 2 ||! cell 3 ||%0a|| cell 1 || cell 2 || cell 3 ||%0a(:markupend:)%0a%0a%0a!! Formatting cell contents%0a%0aCell contents may be aligned left, centered, or aligned right. %0a* To left-align contents, place the cell contents next to the leading %25pmhlt%25@@||@@%25%25.%0a* To center contents, add a space before and after the cell contents.%0a* To right-align contents, place a space before the cell contents and leave the cell contents next to the trailing %25pmhlt%25@@||@@%25%25.%0a%0a(:markup caption='Cell alignments':)%0a|| border=1 width=100%25%0a||!cell 1 ||! cell 2 ||! cell 3||%0a||left-aligned || centered || right-aligned||%0a(:markupend:)%0a%0a(:markup caption='Default cell alignments':)%0a|| border=1 width=100%25%0a||!cell default||!cell left ||%0a||default-aligned||left-aligned ||%0a(:markupend:)%0a%0aNote that header and detail cells have different default alignments.%0a%0aTo get a cell to span multiple columns, follow the cell with empty cells:%0a%0a(:markup caption='Column spanning':)%0a|| border=1 width=100%25%0a|| |||| right column ||%0a|| || right two columns ||||%0a|| || middle column || ||%0a|| left column || ||||%0a|| left two columns |||| ||%0a|| entire row ||||||%0a|| left column || middle column || right column ||%0a(:markupend:)%0a%0aTo get a cell to span multiple rows, add '''[@++@]''' after the cell text (2 or more plus characters make the cell span that many rows):%0a%0a(:markup:)%0a|| border=1%0a||Span 3 rows+++ ||Regular cell ||%0a||Cell 2nd column ||%0a||Cell 2nd column ||%0a||Some text || Span 2 rows ++ ||%0a||First column ||%0a(:markupend:)%0a%0aIf a cell text needs to end with 2 or more plus characters, insert the empty space character [@[==]@] after them.%0a%0aTo make the rowspan more visible when editing, you can insert a cell with only caret "^" characters and it will be ignored:%0a%0a(:markup:)%0a|| border=1%0a||Span 3 rows+++ ||Regular cell ||%0a||^^^^^^^^^^^^^^^||Cell 2nd column ||%0a||^^^^^^^^^^^^^^^||Cell 2nd column ||%0a||Some text || Span 2 rows++ ||%0a||First column ||^^^^^^^^^^^^^^^^||%0a(:markupend:)%0a%0a%0a!! Table attributes%0a%0aAny line that begins with %25pmhlt%25@@||@@%25%25 but doesn't have a closing %25pmhlt%25@@||@@%25%25 sets the ''table attributes'' for any tables that follow. These attributes can control the size and position of the table, borders, background color, and cell spacing. (In fact these are just standard HTML attributes that are placed in the %3ctable> tag.)%0a%0aUse the [@width=@] attribute to set a table's width, using either a percentage value, an absolute size, or '''*'''.%0a%0aSee also $SimpleTableDefaultClassName.%0a%0a(:markup caption='Table width':)%0a|| border=1 width=100%25 %0a|| cell 1 || cell 2 || cell 3 ||%0a|| c1 || cellcellcellcell2 || cell 3 ||%0a(:markupend:)%0a%0aThe [@border=@] attribute sets the size of a table's borders.%0a%0a(:markup caption='Bordered table' class=horiz:)%0a|| border=10 width=70%25%0a||!cell 1 ||! cell 2 ||! cell 3||%0a||left-aligned || centered || right-aligned||%0a(:markupend:)%0a%0a(:markup caption='Borderless table' class=horiz:)%0a|| border=0 width=70%25%0a||!cell 1 ||! cell 2 ||! cell 3||%0a||left-aligned || centered || right-aligned||%0a(:markupend:)%0a%0aUse [@align=center@], [@align=left@], and [@align=right@] to center, left, or right align a table. Note that [@align=left@] and [@align=right@] create a ''floating table'', such that text wraps around the table.%0a%0a(:markup caption='Table alignment: center':)%0a|| border=1 align=center width=50%25%0a||!cell 1 ||! cell 2 ||! cell 3||%0a||left-aligned || centered || right-aligned||%0aNotice how text does not wrap with a table using "align=center".%0a(:markupend:)%0a%0a(:markup caption='Table alignment: left':)%0a|| border=1 align=left width=50%25%0a||!cell 1 ||! cell 2 ||! cell 3||%0a||left-aligned || centered || right-aligned||%0aNotice how text wraps to the right of a table using "align=left".%0a(:markupend:)%0a%0a(:markup caption='Table alignment: right':)%0a|| border=1 align=right width=50%25%0a||!cell 1 ||! cell 2 ||! cell 3||%0a||left-aligned || centered || right-aligned||%0aNotice how text wraps to the left of a table using "align=right".%0a(:markupend:)%0a%0aNote: to get a table to align left (but not "float left") requires CSS, as in%0a->%25pmhlt%25[@||style="margin-left:0px;"@]%0a%0aThe [@bgcolor=@] attribute sets the background color for a table. At present there is no way to specify the color of individual rows or cells in this type of table (but see Cookbook:FormattingTables).%0a%0a(:markup class=horiz:)%0a|| border=1 align=center bgcolor=yellow width=70%25%0a||!cell 1 ||! cell 2 ||! cell 3||%0a||left-align || center || right-align||%0a(:markupend:)%0a%0a!! Sortable tables [[#sortable]]%0aTo allow readers to reorder a table, give it the class="sortable" attribute:%0a(:markup:)%0a|| class="sortable simpletable"%0a||! m||!Geographic zone ||!Highest point ||!Country ||%0a|| 3700||Arctic ||Gunnbjørn Fjeld ||Greenland ||%0a|| 8848||North Temperate Zone ||Mount Everest ||Nepal ||%0a|| 5790||North Tropical Zone ||Cayambe ||Ecuador ||%0a|| 6768||South Tropical Zone ||Huáscarán ||Peru ||%0a|| 6960||South Temperate Zone ||Aconcagua ||Argentina ||%0a|| 4892||Antarctic ||Mount Vinson ||(none) ||%0a(:markupend:)%0a%0aNotes:%0a* This feature has to be enabled in local configuration, see $EnableSortable. It will then work both for simple tables as above, and for [[table directives]] with the class="sortable" attribute.%0a* The optional "simpletable" class is available in core skins and possibly other skins, it should define reasonably simple table styles.%0a* The first row of the table needs to have heading cells with %25pmhlt%25 [@||!@]%25%25 separators which can be clicked to order the rows by the column.%0a* If the last row of your table should be a footer that is not sorted, use the class "sortable-footer" instead of "sortable". If you use %25pmhlt%25 [@||!@]%25%25 separators in the footer, they will also allow the rows to be sorted, like the header cells.%0a%0aData types: By default, the rows are sorted numerically, if the cells contain unformatted numeric values, or alphabetically. You can define the sorting data type of a column by adding to the heading cell an empty [[WikiStyle(s)]] element:%0a* %25pmhlt%25@@[=%25sort-numeric-us%25%25%25=]@@ - cells in the column contain US-formatted numbers like @@1,234.56@@.%0a* %25pmhlt%25@@[=%25sort-numeric%25%25%25=]@@ - cells in the column contain SI-formatted numbers like @@1 234,56@@.%0a* %25pmhlt%25@@[=%25sort-date%25%25%25=]@@ - cells in the column contain dates or date-times that will be parsed by the browser. Dates like "2023-11-19" or "2023-11-19 14:09:11" should be correctly parsed, other dates in English might be correctly detected or not.%0a* %25pmhlt%25@@[=%25sort-time%25%25%25=]@@ - the cell contains a %25hlt html%25@@%3ctime datetime="...">%3c/time>@@ element, and its "datetime" value should be used for sorting. Markup like %25pmhlt%25@@[=@2022-01-08T10:07:08Z=]@@ or @@[={(ftime "%25L" "{*$LastModifiedTime}")}=]@@ would output a %3ctime> element in the timezone of the visitor, with more or less precision depending on $EnableLocalTimes, but the "datetime" attributes should allow precise sorting.%0a%0a!! FAQ%0a>>faq%3c%3c [[#faq]]%0aQ: How do I create a basic table? %0aA: Tables are created via use of the double pipe character: @@||@@. Lines beginning with this markup denote rows in a table; within such lines the double-pipe is used to delimit cells. In the examples below a border is added for illustration (the default is no border).%0a%0a(:markup caption='Basic table' class=horiz:)%0a|| border=1 rules=rows frame=hsides%0a|| cell 1 || cell 2 || cell 3 ||%0a|| cell 1 || cell 2 || cell 3 ||%0a(:markupend:)%0a%0aQ: How do I create cell headers?%0aA: Header cells can be created by placing ! as the first character of a cell. Note that these are ''table headers'', not ''headings'', so it doesn't extend to !!, !!!, etc.%0a%0a(:markup caption='Table headers' class=horiz:)%0a|| border=1 rules=cols frame=vsides%0a||! cell 1 ||! cell 2 ||! cell 3 ||%0a|| cell 1 || cell 2 || cell 3 ||%0a(:markupend:)%0a%0aQ: How do I obtain a table with thin lines and more distance to the content?%0aA: "Thin lines" is tricky and browser dependent, but the following works for Firefox and IE (Nov. 2009):%0a%0a(:markup caption='Thin lines and cell padding' class=horiz:)%0a||border="1" style="border-collapse:collapse" cellpadding="5" width=66%25%0a||!Header ||! Header || '''Header'''||%0a||cells || with || padding||%0a|| || || ||%0a(:markupend:)%0a%0aQ: How do I create an advanced table? %0aA: See [[PmWiki.TableDirectives | table directives]]%0a%0aQ: My tables are by default centered. When I try to use '||align=left' they don't align left as expected. %0aA: Use ||style="margin-left:0px;" instead. %0a%0aQ: How can I specify the width of columns?%0aA: You can define the widths via custom styles, see Cookbook:FormattingTables and $TableCellAttrFmt. Add in config.php :%0a[@$TableCellAttrFmt = 'class=col$TableCellCount';@]%0a-> And add in pub/css/local.css : %0a[@%0atable.column td.col1 { width: 120px; }%0atable.column td.col3 { width: 40px; }%0a@]%0a%0aQ: How can I display a double pipe "||" in cell text using basic table markup?%0aA: Escape it with [@[=||=]@] to display || unchanged.%0a%0aQ: How do I apply styles to the elements of the table, like an ID to the table row, or a class/style to the TD?%0aA: See [[PmWiki/WikiStyles#WikiStyleApply | $WikiStyleApply]].%0a%0aAlternately, use [[table directives]], which allow specifying styling either directly (''style="..."'') or by a ''class="..."'' attribute for CSS.%0a%0aQ: Is there a simple way to change the table defaults? I prefer a border and I'm tired of adding it to every table.%0aA: You can set %25hlt php%25 @@$SimpleTableDefaultClassName = 'simpletable';@@ and/or define your own styles in your stylesheet. The "simpletable" class is available in the core skins, and can be redefined or overridden in pub/css/local.css.%0a +time=1723977749 |