Download the PHP package heineref/kirby-listsubpages without Composer
On this page you can find all versions of the php package heineref/kirby-listsubpages. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download heineref/kirby-listsubpages
More information about heineref/kirby-listsubpages
Files in heineref/kirby-listsubpages
Package kirby-listsubpages
Short Description The KirbyTag “listsubpages” generates a list of all subpages — e.g. the visible ones — in the form of a link list
License MIT
Informations about the package kirby-listsubpages
Kirby Plugin: Listsubpages
By using the KirbyTag listsubpages, a dynamically generated links list with clickable links to the "subpages" of the respective page (or a parent page specified in the KirbyTag) and a freely selectable heading (e.g., "Select the desired page:") can be inserted into any textarea field in the panel.
The links list can be displayed in reverse order, without its own page, with its own page as text instead of as a link.
Drafts, unlisted and/or listed child pages can be included in the list; however, the draft and unlisted subpages are only visible if the website visitor is logged in!
If there are no subpages, NOTHING is displayed in the frontend.
For this reason, the heading (e.g. "Select the desired page:") is also displayed by the KirbyTag listsubpages (or not, if no pages are listed).
A basic example:
This basic example uses a hypothetical webpage, which has three subpages.
Insert a table of contents for all visible "subpages" that are formatted as links in a textarea field in the panel
This generates the following HTML code in the front end:
and then this is visible in the frontend:
Select the desired page:
- Subpage 1
- Subpage 2
- Subpage 3
Installation
Download
Download the contents of this repository as Zip file.
Rename the extracted folder to heineref_listsubpages and copy it into the site/plugins/ directory in your Kirby project. If it does not exist, create a new directory site/plugins/ first.
This file README.md therefore receives the path site/plugins/heineref_listsubpages/README.md.
Composer
Git submodule
If you have used git in your project before:
Setup
Other translations
Put your translations files to other languages (must be php files) into the Plugin subfolder ./translations.
That's it, no configuration needed.
Options
All options require HeinerEF.listsubpages. as prefix.
listtag
- default: ul
- the tag used for the list of the subpage links:
- ul = bullet point (unordered list) - the default
- ol = numbered list (ordered list)
showstatuses
- default: TRUE
- show the status of the page if it is not 'listed'
- however, the draft and unlisted subpages are only visible if the website visitor is logged in!
Using the KirbyTag
Display the table of contents (list of the subpages) on a webpage
Display a table of contents (list of the subpages) with the heading "Select another page:"
Note: Place the heading direct after "listsubpages:" in front of all other KirbyTag attributes!
Display the table of contents (list of the subpages) of the blog page, which has the path "/blog", e.g. on a blogarticle page:
Display the table of contents (list of the subpages) of the blog page, which has the path "/blog", e.g. on a blogarticle page, without the current page
Display the table of contents (list of the subpages) of the blog page, which has the path "/blog", e.g. on a blogarticle page, showing the current page as text rather than a link
Display the table of contents (subpages) in reverse order
Display the table of contents (subpages) as a numbered list
"children"-options:
In Kirby, pages can have three states:
- draft
- unlisted
- listed
Drafts are only accessible to logged-in users, while listed and unlisted pages are accessible via their URL.
However, these differences are only visible if the website visitor is logged in!
| children | draft | unlisted | listed | comment |
|---|---|---|---|---|
| x | x | (default) | ||
| all | x | x | x | |
| onlylisted | x | |||
| onlyunlisted | x | |||
| onlydraft | x | |||
| notlisted | x | x | ||
| notunlisted | x | x |
Output a table of contents for all child pages (drafts, public and unlisted), but drafts only for logged in Kirby user
Output a table of contents for listed child pages
Output a table of contents for unlisted child pages
Output a table of contents for drafts child pages
Output a table of contents for drafts and unlisted child pages
Output a table of contents for drafts and listed child pages
Other options:
Display a table of contents without the statuses of subpages (otherwise, this is displayed only for logged in Kirby user)
Otherwise, the option(‘HeinerEF.listsubpages.showstatuses’) or the default TRUE are taken into account.
Output a table of contents with the CSS class "testclass" instead of the default class "listsubpages" (for details look at the "basic example")
Output a specially formatted table of contents
Requirements
This plugin was built using Kirby 3.x and updated up to Kirby 5.x. It does not work as is with older versions of Kirby.
Disclaimer
This plugin is provided "as is" with no guarantee. Use it at your own risk and always test it yourself before using it in a production environment.
License
MIT
It is not permitted to use this plugin in any project that promotes racism, sexism, homophobia, animal abuse, violence or any form of hate speech.
Credits
- Bastian Allgeier for Kirby and its KirbyTags