Giter VIP home page Giter VIP logo

dw-plugin-pagetitle's Introduction

PageTitle plugin for DokuWiki

Render title on the page

Define and render a pagename, in other words a title of the wiki page.

  <title>
  **PageTitle** plugin for DokuWiki
  </title>

The specified page title is rendered as <h1 class="pagetitle"> element on the page. You can use bold, italic, superscript and subscript text to show appropriate title on the page, for instance a chemical formula [FeII(CN)6]4-. The formatted title is shown on the page, but it is converted to a plain text for the title of HTML document, like [FeII(CN)6]4-. PageTitle plugin overwrites 'title' value of the metadata of the page to store the plain title text. You may choose to use persistent metadata storage in the Configuration manager to prevent pagetitle reverted or wrongly set during rendering process.

The page 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.

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

  ~~Title: PageTitle plugin for DokuWiki ~~

Hierarchical breadcrumbs on the page

(expermental)

  <!--YOU_ARE_HERE-->

This syntax allow you to put 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 available if you want use shorter title instead of (longer) pagetitle in the hierarchical breadcrumbs.


Licensed under the GNU Public License (GPL) version 2

More infomation is available:

(c) 2014-2023 Satoshi Sahara <[email protected]>

dw-plugin-pagetitle's People

Contributors

julianze avatar ssahara avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

akwiat vaniwiki

dw-plugin-pagetitle's Issues

Config Option to remove HTML around "youarehere"

Hi,

thanks for this great Plugin, i love the youarehere-Feature, so i can now put this in my pages.

It would be great if there will be an config Option, to remove the HTML block elements around the hierarchical breadcrumbs.

I would linke t use the youarehere-Output inline, without any breaks vor block elements.

Would this be possible?

Thanks

ShortTitle is not displaying consequently - cache?

Hi,

i extensivley played around with the "YOU_ARE_HERE" options and ShortTitles on every page in my test environment.
I noticed that sometimes the pagetitel (id of the site) is not consequently replaced by the ShortTitle.

Just tested with several options, but i can´t identify a systematology.
I have added some echo in the helper.php on Line 55 for the variables $id and $name to get some more informations about.
The function p_get_metastorage() seems to not correctly return the translated ShortTitle.

Look here:
Correct translation:
ID: wiki:start;
Name: wiki;

ID: wiki:it-betrieb:start;
Name: IT-Betrieb;

ID: wiki:it-betrieb:start;
Name: IT-Betrieb;

Severel requests later:
ID: wiki:start;
Name: wiki;

ID: wiki:it-betrieb:start;
Name: it-betrieb;

ID: wiki:it-betrieb:start;
Name: start;

Now resaved the configuration to clear the cache:
ID: wiki:start;
Name: wiki;

ID: wiki:it-betrieb:start;
Name: IT-Betrieb;

ID: wiki:it-betrieb:start;
Name: IT-Betrieb;

Resaving the config to clear the cache often helps, but not always.
In every page i added the ~~NOCACHE~~ without permanent success.

On other pages only a part of the id is translated correctly - so i can´t say it will completely or nothing will be translated:
Example:
ID: wiki:start;
Name: wiki;

ID: wiki:it-betrieb:start;
Name: it-betrieb;

ID: wiki:it-betrieb:2:start;
Name: 2;
-> Should be: Übersicht L2
ID: wiki:it-betrieb:2:hyperv:start;
Name: Hyper-V;

ID: wiki:it-betrieb:2:hyperv:start;
Name: Hyper-V;

The DW option useHeadings is disabled.
And the plugin option usePersistent doesn't solves this.

Removing the parameter METADATA_DONT_RENDER in the p_get_metastorage (helper.php - line 55) does not help too.

I use Release 2018-04-22b "Greebo" with latest PageTitle-plugin.
On a fresh installation it's the same behavior.

Are there any tricks to get permanent ShortTitle translation?

Do you want to have a look:

http://wiki2.j-z.it/dokuwiki/doku.php?id=wiki:it-betrieb:start
Pages under the namespace: wiki:it-betrieb:

Thanks

Julian

(Re-)activating the plugin should clear/regenerate the caches

Problem

pagetitle plugin enabled 1

Workaround on a per page basis:

Use the intended function for clearing the cache of one page

https://www.dokuwiki.org/devel:caching#purging_the_cache

Or make a (pseudo) edit and save

pagetitle plugin enabled 2

pagetitle plugin enabled 3

Workaround for the whole wiki

https://www.dokuwiki.org/caching#purging_the_cache

Proposed solution within responsibility of the plugin

Upon activation or more relevant re-activation (likely that you have placed some <title> elements onto multiple pages) the plugin should regenerate caches.

  • Either simply everywhere (A simple function call
  • or maybe only selectively on pages where it encounters its markup (more complex, but maybe more performant).

PHP error when page content changes

I get the following error after changing the content of a page, pressing F5 to refresh twice fixes it.

PHP Warning:  Undefined array key "metadata" in C:\inetpub\wwwroot\manual\lib\plugins\pagetitle\syntax\decorative.php on line 146
PHP Warning:  Undefined array key "xhtml" in C:\inetpub\wwwroot\manual\lib\plugins\pagetitle\syntax\decorative.php on line 146

Fixed by adding the following at the top of the render() function in decorative.php:

		$counter['metadata'] = 0;
		$counter['xhtml'] = 0;

persistent metadata storage

Hi,

I don't know what the configuration "persistent metadata storage" means and I don't find any hints for this. Could you please give some instructions for this

Best regards
Juergen

Invisible title syntax: Rendered as raw markup AND not put into html head title

Versions

DokuWiki 2020-07-29 "Hogfather"
PageTitle 2019-09-29 is reported to be incompatible with Hogfather, and this my bug report confirms this.

Reproduction

  • The plugin is enabled and is working to some degree. This can also be seen in #19 and #20
  • Put the invisible syntax ~~ My custom title ~~ into page source and save.

Expected

  • Title is not shown in page content but only in <html> <head> <title>.

Actual

  • It is rendered as the raw markup.
  • <html> <head> <title> still uses the generic title scheme "pagetitle [Wiki Name]"

pagetitle invisible title markup

doublequotes converted wrongly to html entity &quot; in ~~Title:*~~ syntax

The fix 06654f9 (merge metaonly into decorative component) caused this issue that double quotes " in ~~Title:*~~ syntax converted to html entity &quot;.

The special chars in title string will be converted to html entities later, i.e. in tpl_pagetitle() defined in inc/template,php file. Therefore it is not necessary to use hsc() or htmlspecialchars() in this plugin.

Plugin breaks configuration site (and style at all)

Hi,

first I have to say, I really like this plugin, it's exactly what I had looking for. Well, it works as expected, but it breaks my dokuwiki configuration and the theme.

After I have installed this plugin, my configuration site stops after

Pagetitle
Define a title of the wiki page by
DokuWiki_Pagetitle_fail_config

The TOC ist completly shown but cut off after this line. So I have no access to my themes settings. Also it breaks the configuration itself, beacuse footer settings and userstyle.css are ignored.
After I habe removed the plugin, configuration site was shown completly again, but all theme settings where gone. :(

DokuWiki: 2018-04-22 "Greebo"
PHP: 7.3.6 (also tested with 7.0.33)
Theme: Bootstrap3 Template 2019-05-22
Plugin: 2019-05-08

Kind regards,
Frank

HTTP ERROR 500 after update to current version (2017-07-30)

After updating this plugin my wiki ("Frusterick Manners" tested on sub-version e & b ) responded with a complete Http500.

I rolled back to an earlier version and tested every single file, looks like breadcrumb.php or decorative.php causes it.

I'll install a test instance of DW and try to enable verbose PHP error logging to investigate this, if you want.

Visible title syntax: Rendered in page but not put into html head title

Versions

DokuWiki 2020-07-29 "Hogfather"
PageTitle 2019-09-29 is reported to be incompatible with Hogfather, and this my bug report confirms this.

Reproduction

  • The plugin is enabled and is working to some degree. This can also be seen in #19.
  • Put the visible syntax into page source and save.

Expected

  • Title is rendered in page and also makes it into <html> <head> <title>, the main purpose of the plugin.

Actual

  • It is rendered.
  • But <html> <head> <title> still uses the generic title scheme "pagetitle [Wiki Name]"

pagetitle visible title markup

Special syntax to replace the full title

Would be nice if one could override the full title, ie. including config:title as well. My example is that I'd like my front page to be titled by the site's name, but all other pages to include it in the normal way.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.