DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:pagetitle

PageTitle Plugin

Compatible with DokuWiki

  • 2024-02-06 "Kaos" unknown
  • 2023-04-04 "Jack Jackrum" unknown
  • 2022-07-31 "Igor" unknown
  • 2020-07-29 "Hogfather" no

plugin Define a title of the wiki page by <title> tag. This plugin allows to write decorative title on the page with setting plain title text in metadata storage.

Last updated on
2023-08-30
Provides
Syntax
Repository
Source

Similar to meta

Tagged with breadcrumb, title

Installation

Search and install the plugin using the Extension Manager. Refer to plugin installation instructions on how to install plugins manually.

Examples/Usage

Define and render a title of the wiki page

<title classes #id>
**Page Title** plugin for DokuWiki
</title>

The specified title becomes the title of HTML document in combination with your DokuWiki site title. You may need to set useheading option to “navigation” (other than “0”) in order to show specified title in the browser title bar.

You can use bold, italic, superscript and subscript text to show appropriate title on the page. The formatted page title is shown on the page, but it is converted to a plain text for the title of HTML document. The pagetitle plugin overwrites 'title' value of the metadata to store the plain title text. You can give classes or #id to the title element (<h1>) if wrap plugin is available in your wiki site.

When there are multiple <title> entries in a page, the first entry should be effective.

If you want to set a page title without showing itself on the page, you can instead use following syntax macro:

~~Title: Page Title plugin for DokuWiki ~~

CSS for PageTitle

You can use class selector “pagetitle” for the HTML element of Page Title rendered in the page.

.dokuwiki h1.pagetitle {
    text-align: center;
}

Hierarchical breadcrumbs on the page

(expermental)

<!--YOU_ARE_HERE-->

This syntax allow you to put a hierarchical breadcrumbs in the page. The place holder <!--YOU_ARE_HERE--> is replaced by the hierarchical breadcrumbs provided by this plugin, which uses page id for a breadcrumbs name independently from $conf('useheading') setting.

~~ShortTitle: pageTitle ~~

ShortTitle macro is additionally available if you want use shorter title instead of (longer) pagetitle in the hierarchical breadcrumbs.

Development

ToDo/Wish List

  • <title> syntax to define pagename (title of the page) on the page (v2 branch) → done in release 2015-09-24
  • '<!--YOU_ARE_HERE--> syntax to show a Hierarchical breadcrumbs on the page (v2 branch) → done in release 2015-09-24

Known Bugs and Issues

Incompatibilities with 2020-07-29 Hogfather

parse error after upgrade

After I did an upgrade to the most recent version of the plugin, my dokuwiki instance became dysfunctional (white screen of death). The logs of my apache2 server contained this hint:

[Wed May 08 00:17:48.543750 2019] [:error] [pid 19136] [client 130.75.103.103:35866] PHP Parse error:  syntax error, unexpected '=' in /srv/www/iqwiki.iqo.uni-hannover.de/lib/plugins/pagetitle/syntax/shorter.php on line 72

The server runs on PHP 7.0 . Dokuwiki itself is on greebo.

KaiMartin 2019-05-08 00:23

Just a hint from me: As far as I can see, you are not using Greebo… (The icons are not from Greebo.) — Michael Sy. 2019-05-08 00:45
The plugin requires PHP 7.1.x or later. However, PageTitle release 2019-05-08 should work with PHP 7.0.x that has already ended its life. Please refer to https://www.php.net/supported-versions.phps.sahara 2019-05-08 00:56

I can confirm functionality on PHP7.1. Maybe you should correct your commit description on github. PHP 7.0.x support is a little misinterpretative. ;) — Punkt 2019-06-25 13:30

Pagetitle makes my Detritus crash (error 500), at mekineer.com. PHP version: 7.3.6 sorry, it was actually running 5.6.40. I updated my site to use 7.0.x, and pagetitle works now.

I'm a bit confused about functionality. I am using indexmenu plugin, and want the URL path for the menu. However, I want the page title to be what's in <title>. This way, I can keep my menu with brief names, yet have the page title be more descriptive. Is this not possible? — mekineer 2020-01-16 02:51

There seems to be a problem with the tag: it should have a capital:<title>…</title> but <Title>..</Title>. If not using a capital the title is not changed in the metadata. This is inline with the hidden version ~~Title: Page Title plugin for DokuWiki ~~ . Unfortunately is not well rendered anymore 2024-07-10 15:33

plugin/pagetitle.txt · Last modified: by Aleksandr

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