DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:tplmod

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:tplmod [2019-01-15 13:05] – [Per User Interface Language] turnermmplugin:tplmod [2024-04-03 15:06] (current) LMS23
Line 6: Line 6:
 email      : turnermm02@shaw.ca  email      : turnermm02@shaw.ca 
 type       : action type       : action
-lastupdate : 2019-09-14 +lastupdate : 2021-12-06 
-compatible : Elenor of Tsort, Frusterick Manners,Greebo+compatible : Elenor of Tsort, Frusterick Manners,Greebo,Hogfather,Igor,Kaos,Jack Jackrum
 depends    :  depends    : 
 conflicts  conflicts 
 similar    :  similar    : 
-tags       : template,tools,title,logo,tagline,toggle,sidebar, disable-actions,language+tags       : template,tools,title,logo,tagline,toggle,sidebar, disable-actions,language, cms, hide-menus
  
-downloadurl: https://github.com/turnermm/tplmod/archive/master.zip+downloadurl: https://github.com/turnermm/tplmod/archive/refs/heads/master.zip
 bugtracker : https://github.com/turnermm/tplmod/issues bugtracker : https://github.com/turnermm/tplmod/issues
 sourcerepo : https://github.com/turnermm/tplmod/ sourcerepo : https://github.com/turnermm/tplmod/
Line 24: Line 24:
 Search and install ​the plugin using the [[plugin:extension|Extension ​Manager]]. Search and install ​the plugin using the [[plugin:extension|Extension ​Manager]].
 ====== Usage ====== ====== Usage ======
-This plugin enables you to modify the Dokuwiki template based on IP address, ACL level of the user, and day of the week. The wiki logo (image), tagline, and the wiki name can be rotated by day or changed based on the IP address of the user.  The links and buttons at top ((Site tools)) and side ((Page tools)) of the template can be changed based on the ACL level of the user; similarly the actions that they trigger are also governed by the ACL level of the user.+This plugin enables you to modify the DokuWiki template based on IP address, ACL level of the user, and day of the week. The wiki logo (image), tagline, and the wiki name can be rotated by day or changed based on the IP address of the user.  The links and buttons at top ((Site tools)) and side ((Page tools)) of the template can be changed based on the ACL level of the user; similarly the actions that they trigger are also governed by the ACL level of the user.
  
 ==== Some rationales ==== ==== Some rationales ====
-Being able to make these kinds of changes based on IP address makes it possible to run a site which caters to more than one entity and to give each one its own tools, logo, etc.  Changing by date makes it possible to freshen the appearance of a page for repeat visitors.  The ability to restrict the kinds of tools users have access to can have use for sites that want to fine-tune access.+Being able to make these kinds of changes based on IP address makes it possible to run a site which caters to more than one entity and to give each one its own tools, logo, etc.  Changing by date makes it possible to freshen the appearance of a page for repeat visitors.  The ability to restrict the kinds of tools users have access to can have use for sites that want to fine-tune access. The [[#individual_user_interface_languages|per-user language]] option, which lets users select their own user-interface language, expands the usefulness of the plugin to multi-lingual sites.
  
 ==== Template Compatiblities ==== ==== Template Compatiblities ====
Line 43: Line 43:
 The same principle for rotation applies to rotating tag lines and wiki names, as described above for the logos.  The lists of tag lines and wiki names must be in the order in which you want them accessed by either date or IP address. Sunday will access the first tag line or wiki name, the first IP address in your list or IPs will access the first tag line or wiki name.  The default replacement tag or name will be the first in its list. The same principle for rotation applies to rotating tag lines and wiki names, as described above for the logos.  The lists of tag lines and wiki names must be in the order in which you want them accessed by either date or IP address. Sunday will access the first tag line or wiki name, the first IP address in your list or IPs will access the first tag line or wiki name.  The default replacement tag or name will be the first in its list.
  
-In order to implement tagline replacement, you have to set a Dokuwiki [[config:tagline]] in Dokuwiki's configuration settings. The //tplmod// plugin supports one level of HTML markup.  For instance, you can set the Configuration tagline as ''<b>My thoughts about things</b>'' and the plugin will leave the HTML in place and replace "My thoughts about things" with a new tagline.  You could in fact set the Configuration tagline as follows: ''<b></b>'', then all of the taglines will automatically be bold.+**Important** \\ In order to implement tagline replacement, you have to set a Dokuwiki [[config:tagline]] in Dokuwiki's configuration settings. The //tplmod// plugin supports one level of HTML markup.  For instance, you can set the Configuration tagline as ''<b>My thoughts about things</b>'' and the plugin will leave the HTML in place and replace "My thoughts about things" with a new tagline.  You could in fact set the Configuration tagline as follows: ''<b></b>'', then all of the taglines will automatically be bold.
 ==== The Date Tagline ==== ==== The Date Tagline ====
 if the ''tag_date_format'' is set, then a formatted date string will be output as the tag. The formatting uses a  if the ''tag_date_format'' is set, then a formatted date string will be output as the tag. The formatting uses a 
 [[http://php.net/manual/en/function.date.php|php date]] string.  For instance: [[http://php.net/manual/en/function.date.php|php date]] string.  For instance:
     \T\o\d\a\y \i\s l F jS Y     \T\o\d\a\y \i\s l F jS Y
-This will output ''Today is Tuesday July 4th 2017'' (or whatever the date is).  Notice that all the text which is not part of the actual date itself is escaped: ''\T\o\d\a\y \i\s'' Not every character has to be escaped, only those which wll be interpreted as formatting characters.  The date tagline takes precedence over the rotating taglines, so you cannot have both a date tagline and rotating tagline. As with the rotating taglines, a Dokuwiki [[config:tagline]] must be set in the Configuration Manager.+This will output ''Today is Tuesday July 4th 2017'' (or whatever the date is).  Notice that all the text which is not part of the actual date itself is escaped: ''\T\o\d\a\y \i\s'' Not every character has to be escaped, only those which wll be interpreted as formatting characters.  The date tagline takes precedence over the rotating taglines, so you cannot have both a date tagline and rotating tagline. \\ **Please Note:** As with the rotating taglines, a Dokuwiki [[config:tagline]] must be set in the Configuration Manager.  Moreover, for the ''rotatewhich'' option, either ''BOTH'' or ''TAG'' must be selected.
  
 ===== ACL controls ===== ===== ACL controls =====
Line 69: Line 69:
 ===== Sidebar Toggle ===== ===== Sidebar Toggle =====
 The sidebar toggle mechanism is enabled by setting the ''toggle_sidebar'' configuration option to ''true''. See [[https://mturner.org/devel/start|mturner.org]] for an example of its use.  The toggle is an action link at the top right of the page. The sidebar toggle mechanism is enabled by setting the ''toggle_sidebar'' configuration option to ''true''. See [[https://mturner.org/devel/start|mturner.org]] for an example of its use.  The toggle is an action link at the top right of the page.
 +
 +An adjunct to sidebar toggling is the facility to suppress the sidebar by page and namespace.  The pages and namespaces are set in the Configuration Manager, using the ''xcl_sidebar'' setting.
 ===== Supported Templates ===== ===== Supported Templates =====
 Tplmod was initially desiged for use with the default DokuWiki template. While tplmod should work with templates based on the DokuWiki [[template:starter|starter template]], there could be differences that stand in the way of some of the functions that tplmod provides.  However, there is current  built-in support for these templates: Tplmod was initially desiged for use with the default DokuWiki template. While tplmod should work with templates based on the DokuWiki [[template:starter|starter template]], there could be differences that stand in the way of some of the functions that tplmod provides.  However, there is current  built-in support for these templates:
Line 78: Line 80:
 ===== Background Color Setting ===== ===== Background Color Setting =====
 The ''background_color'' setting makes it possible to set the color of the browser area which surrounds the wiki. This can often be done using the "Template Style Settings" in the Admin panel.  But there are some cases where this setting can be useful, as in the [[template:monochrome]] template, where the background color fills the entire browser area before the wiki page color is activated. This may cause a choppy effect as the background color for the wiki sections  replace the browser color.  The solution is to set the background color of the template to the page color in the "Template Style Settings". Then the entire page is loaded using this background color, after which tplmod will set the surrounding background color. In the pattern set down by the current Dokuwiki template, the wiki page color is white (#ffffff) and the template background setting is ''__background_alt__'' For this to work you have to check off ''default'', which is the only option, and will trigger ''__background_alt__'' or else enter the color code for the background color which you prefer.   The ''background_color'' setting makes it possible to set the color of the browser area which surrounds the wiki. This can often be done using the "Template Style Settings" in the Admin panel.  But there are some cases where this setting can be useful, as in the [[template:monochrome]] template, where the background color fills the entire browser area before the wiki page color is activated. This may cause a choppy effect as the background color for the wiki sections  replace the browser color.  The solution is to set the background color of the template to the page color in the "Template Style Settings". Then the entire page is loaded using this background color, after which tplmod will set the surrounding background color. In the pattern set down by the current Dokuwiki template, the wiki page color is white (#ffffff) and the template background setting is ''__background_alt__'' For this to work you have to check off ''default'', which is the only option, and will trigger ''__background_alt__'' or else enter the color code for the background color which you prefer.  
-=====Set Per User Interface Language =====+===== Individual User Interface Languages =====
 This feature enables setting of the User Interface language on a per user basis. It's done through the  **User Profile** feature, which can be configured to display a new sub-dialog in which the current user can set the user's own User Interface Language.  This language setting carries over to subsequent DokuWiki sessions, until the user changes the language.  This feature enables setting of the User Interface language on a per user basis. It's done through the  **User Profile** feature, which can be configured to display a new sub-dialog in which the current user can set the user's own User Interface Language.  This language setting carries over to subsequent DokuWiki sessions, until the user changes the language. 
  
Line 85: Line 87:
 ==== Configuration ==== ==== Configuration ====
 The UI Language dialog will not appear in the User Profile until the administrator selects the list of languages which the wiki's users can choose from.  This is done in the Configuration Manager, using the ''deflang'' option of the The UI Language dialog will not appear in the User Profile until the administrator selects the list of languages which the wiki's users can choose from.  This is done in the Configuration Manager, using the ''deflang'' option of the
-**tplmod** plugin.  The selections will then show up in the UI Language dialog as a set of radio buttons. The user can change language as need arises.   +**tplmod** plugin.  The selections will then show up in the UI Language dialog as a set of radio buttons. 
- +{{  https://i.imgur.com/sGsF9fe.png?400  }} 
-The language change occurs immediately upon leaving the **User Profile** dialogs.+   
 +The language change occurs immediately upon leaving the **User Profile** dialogs. The user can change language as need arises.
 ===== Configuration and Settings ===== ===== Configuration and Settings =====
-^ Option            ^ Description                                                                                                                                                                                                                                                                               +^ Option            ^ Description                                                                                                                                                                                                                                                                                                                                                         
-| logos             | Comma separated list of image names for home page logo: names only, not paths                                                                                                                                                                                                             +| logos             | Comma separated list of image names for home page logo: names only, not paths                                                                                                                                                                                                                                                                                       
-| ips               | Comma separated list of IPs for rotation by IP. Rotations follow sequence of IPs                                                                                                                                                                                                          +| ips               | Comma separated list of IPs for rotation by IP. Rotations follow sequence of IPs                                                                                                                                                                                                                                                                                    
-| sitetools         | **Site Tools** \\ Remove the selected site tools. In the Dokuwiki template Site Tools are located at the top of the template.                                                                                                                                                             +| sitetools         | **Site Tools** \\ Remove the selected site tools. In the Dokuwiki template Site Tools are located at the top of the template.                                                                                                                                                                                                                                       
-| pagetools         | **Page Tools** \\ Remove the selected page tools. In the Dokuwiki template these are located along the right-hand side of the template.  You can remove non-standard tools, using the input box:  enter them as a comma separated list of unique words from their query strings or urls.  Selecting ''edit'' will also hide and disable the ''view source'' button | +| pagetools         | **Page Tools** \\ Remove the selected page tools. In the Dokuwiki template these are located along the right-hand side of the template.  You can remove non-standard tools, using the input box:  enter them as a comma separated list of unique words from their query strings or urls.  Selecting ''edit'' will also hide and disable the ''view source'' button. Current versions of ''tplmod'' support a ''Revert'' option, which is not explicitly a button, but setting this to true prevents attackers from reloading old versions of pages in place of the current versions. 
-| profile           | Remove User Profile link                                                                                                                                                                                                                                                                  +| profile           | Remove User Profile link                                                                                                                                                                                                                                                                                                                                            
-| search            | Remove Search box                                                                                                                                                                                                                                                                         +| search            | Remove Search box                                                                                                                                                                                                                                                                                                                                                   
-| taglines          | Comma separated list of taglines                                                                                                                                                                                                                                                          +| taglines          | Comma separated list of taglines                                                                                                                                                                                                                                                                                                                                    
-| tag_date_format   | A PHP [[http://php.net/manual/en/function.date.php|date format string]].   If present, this date string will be output as your tagline                                                                                                                                                    +| tag_date_format   | A PHP [[http://php.net/manual/en/function.date.php|date format string]].   If present, this date string will be output as your tagline                                                                                                                                                                                                                              
-| acl_all           | The ACL level required for access to the sitetoools and pagetools. Users with lesser ACL levels will be barred from access to these tools. Defaults to EDIT.                                                                                                                              +| acl_all           | The ACL level required for access to the sitetoools and pagetools. Users with lesser ACL levels will be barred from access to these tools. Defaults to EDIT.                                                                                                                                                                                                        
-| dateorip          | Rotate logos, tag lines, and wiki names  by ip address or days of the week. Select  ''NEITHER'' if you do not want rotation.                                                                                                                                                              +| dateorip          | Rotate logos, tag lines, and wiki names  by ip address or days of the week. Select  ''NEITHER'' if you do not want rotation.                                                                                                                                                                                                                                        
-| rotatewhich       | If rotating the logo and/or tagline, select which to rotate. You have a choice of NONE, LOGO,TAG, BOTH.                                                                                                                                                                                   +| rotatewhich       | If rotating the logo and/or tagline, select which to rotate. You have a choice of NONE, LOGO,TAG, BOTH. For the ''tag_date_format'', either TAG or BOTH must be selected.                                                                                                                                                                                                                                                          
-| ptools_xcl        | If pagetools is set to ''All'', you can retain selected tools by entering  a comma separated list of unique words from their urls in this text box                                                                                                                                        +| ptools_xcl        | If pagetools is set to ''All'', you can retain selected tools by entering  a comma separated list of unique words from their urls in this text box                                                                                                                                                                                                                  
-| rotate_title      | Rotate the wiki name (title)                                                                                                                                                                                                                                                              +| rotate_title      | Rotate the wiki name (title)                                                                                                                                                                                                                                                                                                                                        
-| wiki_names        | Comma separated list of wiki names                                                                                                                                                                                                                                                        +| wiki_names        | Comma separated list of wiki names                                                                                                                                                                                                                                                                                                                                  
-| toggle_sidebar    | Display a toggle link at the top of the page to page to hide and show the sidebar.  Defaults to false.                                                                                                                                                                                    +| toggle_sidebar    | Display a toggle link in the site tools to hide and show the sidebar.  Defaults to false.                                                                                                                                                                                                                                                              
-| blocking          | Prevent attempts to access hidden actions by adding  ''do=<action>'' parameters to the url.   Defaults to ''true''                                                                                                                                                                        +| blocking          | Prevent attempts to access hidden actions by adding  ''do=<action>'' parameters to the url.   Defaults to ''true''                                                                                                                                                                                                                                                  
-| background_color  | The browser background color, i.e. surrounding the wiki page. See [[#background_color_setting]]                                                                                                                                                                                           +| background_color  | The browser background color, i.e. surrounding the wiki page. See [[#background_color_setting]]                                                                                                                                                                                                                                                                     
-|restricted_group|Name of group which is restricted from accessing the User Profile dialog. If no group is assigned and the profile ''option'' is true, all users will have the User Profile link removed.| +| restricted_group  | Name of group which is restricted from accessing the User Profile dialog. If no group is assigned and the profile ''option'' is true, all users will have the User Profile link removed.                                                                                                                                                                            
-|deflang|User Interface Languages.  Select the languages from which users can set their own UI Language in the User Profile dialog|+| deflang           | User Interface Languages.  Select the languages from which users can set their own UI Language in the User Profile dialog                                                                                                                                                                                                                                           | 
 +| xcl_sidebar       | Comma separated list of pages and/or namespaces where sidebar should be suppressed.  Pages should be in ''namespace:pagename'' format. Namespaces as ''namespace:*''                                                                                                                                                                                              |
  
 ===== Development ===== ===== Development =====
plugin/tplmod.1547553945.txt.gz · Last modified: 2019-01-15 13:05 by turnermm

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki