DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:sectiontoggle

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
Next revisionBoth sides next revision
plugin:sectiontoggle [2019-07-28 17:19] – [Examples/Usage] turnermmplugin:sectiontoggle [2019-07-30 02:10] – [Override] turnermm
Line 5: Line 5:
 author     : Myron Turner author     : Myron Turner
 email      : turnermm02@shaw.ca email      : turnermm02@shaw.ca
-type       : syntax +type       : action,syntax 
-lastupdate : 2019-07-22+lastupdate : 2019-07-28
 compatible : 2012-10-13 "Adora Belle", 2013-05-10a "Weatherwax", 2014-09-29b "Hrun", Detritus, Eleonor Of Tsort, Frusterick Manners, Greebo compatible : 2012-10-13 "Adora Belle", 2013-05-10a "Weatherwax", 2014-09-29b "Hrun", Detritus, Eleonor Of Tsort, Frusterick Manners, Greebo
 depends    :  depends    : 
Line 23: Line 23:
 ===== Installation ===== ===== Installation =====
  
-:!: **Requirements:** This plugin requires jQuery and was originally designed for use with the [[template:dokuwiki|DokuWiki Template]]. In its current form, it should work with any template. 
  
 Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually. Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
Line 30: Line 29:
 ===== Examples/Usage ===== ===== Examples/Usage =====
  
-This plugin converts DokuWiki headers into toggles which open and close the sections immediately below them. The plugin has undergone a number of revisions and in its current form, it will work out of the box with any template without any need for configuration. However, configuring the plugin as described in the sections below __may__ be useful for efficiency.((The emphasis here is on may, i.e. possibly if you have large pages with many headers.))  Over twenty templates come pre-configured in the file [[#templatesinipreconfigured_templates|templates.ini]], or you can configure using the [[#configuration|Configuration Manager]].  +This plugin converts DokuWiki headers into toggles which open and close the sections immediately below them.  
 +==== To Configure or Not to Configure ====
  
 +The plugin will work out of the box with any template without any need for configuration. However, configuring the plugin as described in the section on [[#configuring_for_mobile_devices|Configuring for Mobile Devices]]  __may__ be useful for efficiency.((The emphasis here is on may, i.e. possibly if you have large pages with many headers.))  A group of the most suitable templates for phones come pre-configured in the file [[#templatesinipreconfigured_templates|templates.ini]]. You can also configure using the [[#configuration|Configuration Manager]].  
  
-When installed, the sections will initially be closed. Clicking on a header will open the section immediately below the header. Clicking on it again will close the section. Using the two buttons described [[#syntax|below]], the user can open and close all the sections with a single click.  Headers without any text content below them will not be active and will not show the right arrow icon.  In addition, in the Configuration Manager, you can choose to prevent selected headers from being toggled, as in the sample page below. There the **End of Page Ø** header is an ''h5'' which is excluded from being toggled.+==== To Toggle or Not to Toggle ==== 
 +=== Toggling === 
 + 
 +When installed, the sections will initially be closed. Clicking on a header will open the section immediately below the header. Clicking on it again will close the section. Using the two buttons described [[#syntax|below]], the user can open and close all the sections with a single click. 
 + 
 +=== Disabling Toggles === 
 + 
 +Headers without any text content below them will not be active and will not show the right arrow icon. They will simply be standard headers and not toggles. In addition, in the Configuration Manager, you can choose to prevent selected headers from being toggled, as in the sample page below. There the **End of Page Ø** header is an ''h5'' which is excluded, using the Configuration Manager, from being toggled.
  
 {{  https://i.imgur.com/7r3u9Kv.png  }} {{  https://i.imgur.com/7r3u9Kv.png  }}
Line 46: Line 54:
 These buttons will be hidden if toggling is disabled, as described below under Configuration. These buttons will be hidden if toggling is disabled, as described below under Configuration.
  
-==== Override ==== 
-This feature enables you to create a container ''div'' for the page, in which case it is not necessary to set the **name** option for identifying the div which holds the wiki content. However, you must set the **type** option either to ''id'' or to ''class''.   
-<code> 
-~~stoggle_openDIV~~ 
-~~stoggle_closeDIV~~ 
-</code> 
-You place the ''openDIV'' at the top of your wiki page and the ''closeDIV'' at the bottom.  This will create a div with a ''section%%__%%toggle'' id.  The entire wiki page will then be enclosed within this div. In all but the simplest of pages, these macros must be at the very top and the very bottom of your page. 
-  
  
 ===== Configuration ===== ===== Configuration =====
- 
-This plugin was originally written for the DokuWiki template and it defaults to settings for the dokuwiki template. If you are using the DokuWiki template, it will work right out of the box and will convert all headers from h1-h4 into toggles. 
- 
  
 ^  option      ^  options            default                                                                    description                                                                                          ^ ^  option      ^  options            default                                                                    description                                                                                          ^
Line 68: Line 65:
 | xcl_headers  |                    |                                                                            | Checkboxes to select headers which should not be set as toggles                                       | | xcl_headers  |                    |                                                                            | Checkboxes to select headers which should not be set as toggles                                       |
 | mobile_alt                      |                                                                | An alternate template installed for phones, in case your preferred template does not support phones.  | | mobile_alt                      |                                                                | An alternate template installed for phones, in case your preferred template does not support phones.  |
-| tablet_alt   | 1,0                | 0                                                                           | Use the alternate template for tablets  +| tablet_alt   | 1,0                | 0                                                                           | Use the alternate template for tablets 
 |tablet_toggle| 1,0                |0              |Use toggles on tablets as well as phones|                                                               |tablet_toggle| 1,0                |0              |Use toggles on tablets as well as phones|                                                              
  
-**Notes on the Options ** +==== Notes on the Options ==== 
  
     * **Platform **     * **Platform **
Line 78: Line 76:
       * ''none''  : toggling is disabled on all platforms.       * ''none''  : toggling is disabled on all platforms.
     * **Name and Type**     * **Name and Type**
-      * The name is either an id or a class attribute of the div which governs the DokuWiki headers. If you are using the DokuWiki template, you can ignore these options: the plugin automatically detects the template and will use the appropriate settings.  For auto-configurationssee [[#templatesinipreconfigured_templates|Preconfigured Templates]]+      * The ''type'' is either an id or a class and the ''name'' the id or class attribute of the divs which govern the headers. If you are using the DokuWiki template or one of the templates listed in [[#templatesinipreconfigured_templates|templates.ini]], the plugin automatically detects the template and will use the appropriate settings. In the case of the ''templates.ini'' file''type'' must be set to ''none'' or the file will be ignored.
     * **Headers and xcl_headers**     * **Headers and xcl_headers**
       * The headers option selects the smallest header to be converted to a toggle. If you choose h6, all headers between h1 and h6 will be converted to toggles. You can, however, use the xcl_headers setting to omit selected headers from being converted to toggles.       * The headers option selects the smallest header to be converted to a toggle. If you choose h6, all headers between h1 and h6 will be converted to toggles. You can, however, use the xcl_headers setting to omit selected headers from being converted to toggles.
     * **mobile_alt**     * **mobile_alt**
-      * When ''platform'' is set to ''all'' or ''mobile'', this option enables you to switch to an alternate template that supports phones, in the event that your preferred template does not.  If your preferred template does support phones, then set this option to blank. A check is made to insure that that  alternate template is correctly installed, and if not the main template is used. +      * When ''platform'' is set to ''all'' or ''mobile'', this option enables you to switch to an alternate template that supports phones, in the event that your preferred template does not.  If your preferred template does support phones, then set this option to blank. A check is made to insure that that  alternate template is correctly installed, and if not the main template is used.  
     * **tablet_alt**     * **tablet_alt**
       * If set to true the ''mobile_alt'' template will be used for tablets.       * If set to true the ''mobile_alt'' template will be used for tablets.
Line 122: Line 120:
  
   - 20cones   - 20cones
-  - adoradark +  - adoradark 
-  - arctic+
   - arctictut   - arctictut
-  - bootstrap3 +  - bootstrap3 
-  - codowik +
   - dokucms   - dokucms
-  - doogiestpl 
   - flat   - flat
   - greensteel    - greensteel 
   - kajukkk   - kajukkk
-  - material 
   - minima   - minima
   - monochrome   - monochrome
   - prsnl10   - prsnl10
   - sprintdoc   - sprintdoc
-  - twentyfifteen +  - twentyfifteen 
-  - vector+
   - wallpaper   - wallpaper
   - white   - white
plugin/sectiontoggle.txt · Last modified: 2023-12-31 18:13 by 24.78.8.122

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