plugin:sectiontoggle
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:sectiontoggle [2019-07-28 15:50] – [Examples/Usage] turnermm | plugin:sectiontoggle [2023-12-31 18:13] (current) – [sectiontoggle Plugin] 24.78.8.122 | ||
---|---|---|---|
Line 3: | Line 3: | ||
---- plugin ---- | ---- plugin ---- | ||
description: | description: | ||
- | author | + | author |
- | email : turnermm02@shaw.ca | + | email : emoonga1993@gmail.com |
- | type : syntax | + | type : |
- | lastupdate : 2019-07-22 | + | lastupdate : 2023-12-27 |
- | compatible : 2012-10-13 "Adora Belle", | + | compatible : 2012-10-13 "Adora Belle", |
depends | depends | ||
conflicts | conflicts | ||
Line 13: | Line 13: | ||
tags : mobile, tablet, phone, collapsible, | tags : mobile, tablet, phone, collapsible, | ||
- | downloadurl: | + | downloadurl: |
bugtracker : https:// | bugtracker : https:// | ||
sourcerepo : https:// | sourcerepo : https:// | ||
Line 23: | Line 23: | ||
===== Installation ===== | ===== Installation ===== | ||
- | :!: **Requirements: | ||
Search and install the plugin using the [[plugin: | Search and install the plugin using the [[plugin: | ||
Line 30: | Line 29: | ||
===== Examples/ | ===== Examples/ | ||
- | 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.)) | + | This plugin converts DokuWiki headers into toggles which open and close the sections immediately below them. |
+ | ==== 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 [[# | ||
- | 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 [[# | + | ==== To Toggle or Not to Toggle ==== |
+ | === Toggling === | ||
- | {{ https://i.imgur.com/c8AHmEh.png }} | + | When installed, the sections will initially be closed, except as described below under # |
+ | === Auto Toggling === | ||
+ | There are two situations where a toggled section will remain open __when a page loads__. This enables you to link to a section of a page and that section will be open when the page loads. | ||
+ | - When the url accessing the page contains a hash element referencing a page section. | ||
+ | - When the '' | ||
- | ===== Syntax ===== | + | The Dokuwiki table of contents also benefits from auto toggling. |
+ | === 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 '' | ||
+ | |||
+ | |||
+ | {{ https:// | ||
+ | |||
+ | ===== Using the Action Menu Button ===== | ||
+ | |||
+ | As an alternative to the traditional sidebar syntax for open and close buttons, this plugin now offers a more convenient option. Users can opt to use a toggle button located directly in the action menu of the page. | ||
+ | |||
+ | This feature enhances user experience by providing a streamlined and accessible way to control section visibility without the need for additional syntax. | ||
+ | |||
+ | To enable the action menu button: | ||
+ | |||
+ | - Navigate to the plugin configuration settings. | ||
+ | - Locate the option labeled **" | ||
+ | - Enable this option to display the toggle button in the action menu. | ||
+ | |||
+ | Note: Enabling this feature will replace the need for sidebar syntax for opening and closing sections. Users can still use the traditional method if preferred. | ||
+ | |||
+ | ===== Using Syntax ===== | ||
==== Toggle Buttons ==== | ==== Toggle Buttons ==== | ||
Line 45: | Line 73: | ||
~~stoggle_buttons~~ | ~~stoggle_buttons~~ | ||
- | These buttons will be hidden if toggling is disabled, as described below under Configuration. | + | These buttons will be hidden if toggling is disabled |
- | ==== Override | + | ==== Limiting toggles to a section of the page ==== |
- | This feature enables you to create a container | + | The following two macros will mark the start and end of an enclosing |
- | < | + | ~~stoggle_openDIV~~ |
- | ~~stoggle_openDIV~~ | + | ~~stoggle_closeDIV~~ |
- | ~~stoggle_closeDIV~~ | + | These should not cross '' |
- | </ | + | DIV 1 |
- | You place the '' | + | DIV section__toggle |
- | + | Div 1 closed | |
+ | DIV section__toggle closed. | ||
===== Configuration ===== | ===== Configuration ===== | ||
- | This plugin was originally written for the DokuWiki template and it defaults | + | ^ option |
+ | | platform | ||
+ | | type | none, | ||
+ | | name | ||
+ | | headers | ||
+ | | suspend | ||
+ | | xcl_headers | ||
+ | | mobile_alt | ||
+ | | tablet_alt | ||
+ | | tablet_toggle | ||
+ | | xcl_ns | ||
+ | | xcl_pg | ||
+ | | incl_ns | ||
+ | | incl_pg | ||
+ | | h_ini_open | ||
+ | | toc_toggle | ||
+ | | start_open | ||
+ | ==== Notes on the Options ==== | ||
- | |||
- | ^ option | ||
- | | platform | ||
- | | type | none, | ||
- | | name | ||
- | | headers | ||
- | | suspend | ||
- | | xcl_headers | ||
- | | mobile_alt | ||
- | | tablet_alt | ||
- | |tablet_toggle| 1,0 |0 |Use toggles on tablets as well as phones| | ||
- | |||
- | **Notes on the Options ** | ||
* **Platform ** | * **Platform ** | ||
Line 79: | Line 112: | ||
* '' | * '' | ||
* **Name and Type** | * **Name and Type** | ||
- | * The name is either an id or a class attribute | + | * The '' |
* **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 '' |
* **mobile_alt** | * **mobile_alt** | ||
- | * When '' | + | * When '' |
* **tablet_alt** | * **tablet_alt** | ||
* If set to true the '' | * If set to true the '' | ||
+ | * **start_open** | ||
+ | * This option will not apply to mobile devices or to logged in users without edit permission. | ||
- | |||
- | |||
When the toggle buttons are included on a page, they will not display if the platform is excluded from section toggling. So, if you want toggling only on mobile devices, you can still include these buttons on your page but they will not display on standard desktop systems. | When the toggle buttons are included on a page, they will not display if the platform is excluded from section toggling. So, if you want toggling only on mobile devices, you can still include these buttons on your page but they will not display on standard desktop systems. | ||
Line 122: | Line 155: | ||
=== Preconfigured Templates === | === Preconfigured Templates === | ||
- | - 20cones | + | - [[template:20cones]] |
- | - adoradark | + | - [[template:adoradark]] |
- | - arctic | + | - [[template:arctictut]] |
- | - arctictut | + | - [[template:bootstrap3]] |
- | - bootstrap3 | + | - [[template:dokucms]] |
- | - codowik | + | - [[template:flat]] |
- | - dokucms | + | - [[template:greensteel]] |
- | - doogiestpl | + | - [[template:kajukkk]] |
- | - flat | + | - [[template:minima]] |
- | - greensteel | + | - [[template:monochrome]] |
- | - kajukkk | + | - [[template:prsnl10]] |
- | - material | + | - [[template:sprintdoc]] |
- | - minima | + | - [[template:twentyfifteen]] |
- | - monochrome | + | - [[template:wallpaper]] |
- | - prsnl10 | + | - [[template:white]] |
- | - sprintdoc | + | - [[template:writr]] |
- | - twentyfifteen | + | |
- | - vector | + | |
- | - wallpaper | + | |
- | - white | + | |
- | - writr | + | |
plugin/sectiontoggle.1564321815.txt.gz · Last modified: 2019-07-28 15:50 by turnermm