PmWiki /
GroupCustomizationsPmWiki.GroupCustomizations HistoryShow minor edits - Show changes to output March 18, 2011, at 03:58 PM
by - Revert spam
Changed lines 1-88 from:
to:
(:Summary: How to customize a subset of your wiki:) (:Audience: administrators (intermediate) :) One of the purposes of [[Wiki Group]]s is to allow a [[Wiki Administrator]] to customize the features of PmWiki on a per-group basis. Here is where ''per group customizations'' come into play. * The ''local/'' subdirectory (typically in $FarmD) is used to hold local configuration files. * The ''css/'' subdirectory (typically in $FarmD) is used to hold local css files. To perform [[local customizations]] for a particular WikiGroup, * place the customizations in a file called "''<groupname>.php''" (where ''<groupname>'' is the actual name of the page group in question) in the ''local/'' subdirectory * place the css customizations in a file called "''<groupname>.css''" (where ''<groupname>'' is the actual name of the page group in question) in the ''css/'' subdirectory. These files will be automatically processed after processing any local customizations in the ''config.php'' and ''local.css'' files. For example, to change the image displayed in the upper-left corner of pages in the "GroupName" WikiGroup, one could create ''local/GroupName.php'' containing -> [@ <?php $PageLogoUrl = "/myimages/chess.gif"; @] The example's effect would cause all pages in the GroupName [[Wiki Group]] to use "/myimages/chess.gif" as the logo image instead of the default. To add markup to the beginning or end of each page in a wiki group, see [[Group headers]]. !!! Per-page customizations [[#PerPage]] PmWiki also allows per-page customizations, simply use the full name of the page to be customized instead of the group. For example, one can use the file ''local/Chess.`HomePage.php'' to set local customizations for Chess.`HomePage. Almost any customization that would be placed in ''config.php'' can be used as a per-group or per-page customization. An important exception to this is setting '''per-group or per-page customizations for recipe scripts''' included in config.php. Most recipe scripts would need any customization variables defined before the script is included. Instead of using a per-group or per-page customization php file, use a per-group or per-page conditional statement in config.php, before including the recipe script. Example: >>frame<< ->[@$page = PageVar($pagename, '$FullName'); $group = PageVar($pagename, '$Group'); //per-group customizations: if($group=='GroupName') { $RecipeVariable = 'valueA'; etc. ... } //per-page customizations: if($page=='GroupName.PageName) { $RecipeVariable = 'valueB'; etc. ... } //include recipe after variables are set: include_once('cookbook/recipescript.php');@] >><< !!! Processing order For all local customizations, PmWiki first processes the ''local/config.php'' file, and then looks for a per-page customization file in the ''local/'' subdirectory to process, followed by any per-group customization file. If no per-page or per-group customizations are loaded, then PmWiki loads ''local/default.php''. If a per-page customization wants to have the per-group customizations loaded first, it can do so directly by using PHP's [@include_once()@] function. For more information see [[(PmWiki:)wiki cascades]]. !!! Custom CSS styles per group or per-page To apply CSS styles to pages of a specific group named [[Group Name]], create a file named ''GroupName.css'' in the ''pub/css/'' directory and add the CSS style rules there. To apply styles to a specific page, create a file ''GroupName.PageName.css'' in this directory with your style rules. Any CSS rules to be applied for all wiki pages can be put into ''pub/css/local.css''. ->[@/pub/css/GroupName.css: body { background: #F4C4B4; } @] !!! Preventing group-Level configurations Any customization file can set $EnablePGCust=0; to prevent later page/group/default customizations from being automatically loaded. If a per-page customization needs to have the per-group customizations loaded first, it can do so directly by using PHP's [@include_once()@] function. !!! Authentication Any passwords required for a group should be set in the group's [[Group Attributes]] page (see [[Passwords Admin]]istration) and not in a group customization file. !!! Consider Wiki Farms [[Wiki Group]]s are an easy way to host multiple sites in a single PmWiki installation by giving each site its own group. Another approach is to use [[Wiki Farms]], which allows each site to have its own set of [[Wiki Group]] and local customization files. Read about If you are looking for nested group levels, you may want to consider [[PmWiki:HierarchicalGroups|Pm's design considerations on hierarchical groups]]. >>faq<< [[#faq]] Q: How can I apply CSS styles to a particular group or page? A: Simply create a ''pub/css/Group.css'' or ''pub/css/Group.Page.css'' file containing the custom CSS styles for that group or page. Q: Why shouldn't passwords be set in group (or page) customization files? A: The reason for this advice is that per-group customization files are only loaded for the current page. So, if @@[=$DefaultPasswords['read']=]@@ is set in ''local/GroupA.php'', then someone could use a page in another group to view the contents of pages in GroupA. For example, Main.WikiSandbox could contain: --> [=(:include GroupA.SomePage:)=] and because the ''GroupA.php'' file wasn't loaded (we're looking at Main.WikiSandbox --> ''local/Main.php''), there's no read password set. The same is true for page customization files. Q: Isn't that processing order strange? Why not load per page configuration last (that is after global configuration an per group configuration)? A: Many times what we want to do is to enable a certain capability for a group of pages, but disable it on a specific page, as if it was never enabled. If the per-group config file is processed first, then it becomes very difficult/tedious for the per-page one to "undo" the effects of the per-group page. So, we load the per-page file before the per-group. If a per-page customization wants the per-group customizations to be performed first, it can use the techniques given in [[PmWiki.GroupCustomizations]] (using ''include_once()'' or setting @@[=$EnablePGCust = 0=]@@). January 30, 2011, at 10:35 PM
by - rGdXMMcCtnkCpLs
Changed line 1 from:
http://www. to:
http://www.theblockisback.com/balenciaga_grey_medium_motorcycle.html :) http://www.gautamblog.com/burberry-white-westcott-shoulder-bag.html %OOO http://www.gautamblog.com/tory-burch-orange-reva-ballerina-flats.html oktiub http://www.yvettepeters.com/HermesRedCrocodileBirkinMBag.htm %-DDD January 25, 2011, at 08:17 PM
by - QydRrWdqUPNh
Changed line 1 from:
http://www. to:
http://www.pcc2000.com/ambien.php order ambien from ky bve http://www.centralparkposse.com/Acomplia.htm acomplia drug loss weight 8( January 23, 2011, at 03:32 AM
by - hTOtMNwtWqgh
Changed line 1 from:
http://www. to:
http://www.puntodenfoque.com/flurazepam.html flurazepam ohd http://www.faisonsle.com/oxazepam oxazepam zldi January 21, 2011, at 07:18 AM
by - FSJOWlcJR
Changed line 1 from:
http://www. to:
http://www.marsyslaw.org/accutane.html accutane online pharmacy :) http://www.81yiyu.com/ prednisone =(( http://www.citiaction.org/ lunesta 992920 January 18, 2011, at 02:26 PM
by - WLgFVvJnYGwwyzaqh
Changed line 1 from:
http://www. to:
http://www.cafebabelseattle.com/eszopiclone.htm buying eszopiclone =) http://www.theinsurgentcampaign.com/flomax.html order flomax =]]] http://www.johnfritchey.com/risperdal.html online risperdal 542 January 07, 2011, at 03:22 AM
by - LuzULOUmMNUxRFlnN
Changed line 1 from:
http://www. to:
http://www.reclaiminglife.com/ tramadol %DDD http://www.hermanamarthapereyrairaola.org/ acomplia 420911 http://www.centralparkposse.com/Ativan.htm ativan vdnt http://www.centralparkposse.com/Prednisone.htm prednisone 488128 January 05, 2011, at 08:02 PM
by - OofycYql
Changed line 1 from:
to:
http://www.yvettepeters.com/JimmyChooWhiteSnakeSkinBrandySlingbacks.htm jimmy choo slingbacks 157 http://www.theblockisback.com/ysl_pink_muse_two_bag.html ysl replica muse bag =-OOO http://www.theblockisback.com/louis_vuitton_monogram_multicolore_white_judy_mm.html louis vuitton paris graffiti alma mm 8[[[ January 04, 2011, at 06:41 AM
by - BjnhjSkA
Changed lines 1-88 from:
(:Audience: administrators (intermediate) One of the purposes of * The ''local * The ''css/'' subdirectory (typically in $FarmD) is used to hold local css files. To perform [[local customizations]] for a particular WikiGroup, * place the customizations in a file called "''<groupname>.php''" (where ''<groupname>'' is the actual name of the page group in question) in the ''local/'' subdirectory * place the css customizations in a file called "''<groupname>.css''" (where ''<groupname>'' is the actual name of the page group in question) in the ''css/'' subdirectory. These files will be automatically processed after processing any local customizations in the ''config.php'' and ''local.css'' files. For example, to change the image displayed in the upper-left corner of pages in the "GroupName" WikiGroup, one could create ''local/GroupName.php'' containing -> [@ <?php $PageLogoUrl = "/myimages/chess.gif"; @] The example's effect would cause all pages in the GroupName [[Wiki Group]] to use "/myimages/chess.gif" as the logo image instead of the default. To add markup to the beginning or end of each page in a wiki group, see [[Group headers]]. !!! Per-page customizations [[#PerPage]] PmWiki also allows per-page customizations, simply use the full name of the page to be customized instead of the group. For example, one can use the file ''local/Chess.`HomePage.php'' to set local customizations for Chess.`HomePage. Almost any customization that would be placed in ''config.php'' can be used as a per-group or per-page customization. An important exception to this is setting '''per-group or per-page customizations for recipe scripts''' included in config.php. Most recipe scripts would need any customization variables defined before the script is included. Instead of using a per-group or per-page customization php file, use a per-group or per-page conditional statement in config.php, before including the recipe script. Example: >>frame<< ->[@$page = PageVar($pagename, '$FullName'); $group = PageVar($pagename, '$Group'); //per-group customizations: if($group=='GroupName') { $RecipeVariable = 'valueA'; etc. ... } //per-page customizations: if($page=='GroupName.PageName) { $RecipeVariable = 'valueB'; etc. ... } //include recipe after variables are set: include_once('cookbook/recipescript.php');@] >><< !!! Processing order For all local customizations, PmWiki first processes the ''local/config.php'' file, and then looks for a per-page customization file in the ''local/'' subdirectory to process, followed by any per-group customization file. If no per-page or per-group customizations are loaded, then PmWiki loads ''local/default.php''. If a per-page customization wants to have the per-group customizations loaded first, it can do so directly by using PHP's [@include_once()@] function. For more information see [[(PmWiki:)wiki cascades]]. !!! Custom CSS styles per group or per-page To apply CSS styles to pages of a specific group named [[Group Name]], create a file named ''GroupName.css'' in the ''pub/css/'' directory and add the CSS style rules there. To apply styles to a specific page, create a file ''GroupName.PageName.css'' in this directory with your style rules. Any CSS rules to be applied for all wiki pages can be put into ''pub/css/local.css''. ->[@/pub/css/GroupName.css: body { background: #F4C4B4; } @] !!! Preventing group-Level configurations Any customization file can set $EnablePGCust=0; to prevent later page/group/default customizations from being automatically loaded. If a per-page customization needs to have the per-group customizations loaded first, it can do so directly by using PHP's [@include_once()@] function. !!! Authentication Any passwords required for a group should be set in the group's [[Group Attributes]] page (see [[Passwords Admin]]istration) and not in a group customization file. !!! Consider Wiki Farms [[Wiki Group]]s are an easy way to host multiple sites in a single PmWiki installation by giving each site its own group. Another approach is to use [[Wiki Farms]], which allows each site to have its own set of [[Wiki Group]] and local customization files. Read about If you are looking for nested group levels, you may want to consider [[PmWiki:HierarchicalGroups|Pm's design considerations on hierarchical groups]]. >>faq<< [[#faq]] Q: How can I apply CSS styles to a particular group or page? A: Simply create a ''pub/css/Group.css'' or ''pub/css/Group.Page.css'' file containing the custom CSS styles for that group or page. Q: Why shouldn't passwords be set in group (or page) customization files? A: The reason for this advice is that per-group customization files are only loaded for the current page. So, if @@[=$DefaultPasswords['read']=]@@ is set in ''local/GroupA.php'', then someone could use a page in another group to view the contents of pages in GroupA. For example, Main.WikiSandbox could contain: --> [=(:include GroupA.SomePage:)=] and because the ''GroupA.php'' file wasn't loaded (we're looking at Main.WikiSandbox --> ''local/Main.php''), there's no read password set. The same is true for page customization files. Q: Isn't that processing order strange? Why not load per page configuration last (that is after global configuration an per group configuration)? A: Many times what we want to do is to enable a certain capability for a group of pages, but disable it on a specific page, as if it was never enabled. If the per-group config file is processed first, then it becomes very difficult/tedious for the per-page one to "undo" the effects of the per-group page. So, we load the per-page file before the per-group. If a per-page customization wants the per-group customizations to be performed first, it can use the techniques given in [[PmWiki.GroupCustomizations]] (using ''include_once()'' or setting @@[=$EnablePGCust = 0=]@@). to:
k0D7N5 <a href="http://fjliofgygepm.com/">fjliofgygepm</a>, [url=http://isgrguaovzrr.com/]isgrguaovzrr[/url], [link=http://stbxnbnckcye.com/]stbxnbnckcye[/link], http://euimymyvpkye.com/ |