Not logged in. · Lost password · Register
Forum: General Help and Support Plugins RSS
plugin:meta - please provide a full-blown set of sample metacommands
Avatar
hemmerling #1
User title: Rolf Hemmerling, Germany
Member since Jul 2009 · 88 posts · Location: Hannover, Germany
Group memberships: Members
Show profile · Link to this post
Subject: plugin:meta - please provide a full-blown set of sample metacommands
a)

http://www.dokuwiki.org/plugin:meta

I would be pleased if somebody might supply a full-blown example of a set of Dublin Core data as metacommands which ARE accepted by DokuWiki parser. How does an "array" look like ?

Please also explain where and how the values are "used".

This free online tool
DC-dot "Dublin Core metadata editor"
http://www.ukoln.ac.uk/metadata/dcdot/
is somehow useful, but does not solve much of my questions.

DokuWiki just processes
~~META:
title = My Title
~~

and sets this title string as first part of the page title defined by <title>.

b)
In general, “plugin:meta” reads metadata defined in “pages” files. The display is done by other plugins ( e.g. “plugin:metaheaders” ) or by DokuwWiki itself. “plugin:metaheaders”, however, reads the data from the file ”<dokuwiki-rootdir>/conf/metaheaders.conf.php” and can display some data which is processed by “plugin:meta”.

For example,
~~META:
creator = Somebody
&title = My Title
~~

is displayed by
http://www.dokuwiki.org/plugin:metaheaders
if the pattern '@AUTHOR@ is used. Example

File
<dokuwiki root dir>/conf/metaheaders.conf.php:\\

<?php
$headers['meta'][] = array( 'name' => 'The author name', 'content' => '@AUTHOR@' );
$headers['meta'][] = array( 'name' => 'The page title', 'content' => '@TITLE@' );
//end

causes the metatag
<meta name="The author name" content="Somebody" />
<meta name="The page title" content="My Title" />
to be included in any page ( you can limit the meta inclusion to files and directories ).

Most other predefined pattern of plugin:metaheaders, like
  *@ID@
  *@ABSTRACT@
  *@CONTRIBUTORS@
  *@RELATION@
  *@CONTRIBUTORS@
are automatically defined by DokuWiki and can therefore be used by plugin:metaheaders without extra definition in a meta statement. Especially @RELATION@ is nice, as it shows all referers to a page,as list, thanks to DokuWiki ).

c)
Quote "language: a two-letter language code is expected; not set, but defaults to the chosen language for DokuWiki when exported" - hmmm can I now set a language code ? If not, and just the chose language for Dokuwiki is "exported", how to export it ( with plugin:metaheaders,.. )?

d)
So though I can now pimp my website with some nice metacommands, I still need much info how to use the plugin:meta !

Sincerely
Rolf
This post was edited 8 times, last on 2009-12-07, 09:02 by hemmerling.
chi #2
Member since Jun 2006 · 1851 posts · Location: Munich Germany
Group memberships: Members, Super Mods, Wiki Managers
Show profile · Link to this post
Quote by hemmerling:
I would be pleased if somebody might supply a full-blown example of a set of Dublin Core data as metacommands which ARE accepted by DokuWiki parser. How does an "array" look like ? Please also explain where the values are "used" ( = are visible in the HTML code, or where else ) ?

First you have to distinguish between the page related meta data (that's what the meta plugin interacts with) which DokuWiki stores in the data/meta/<pagename>.meta files, and the metaheaders of the generated HTML page (which is what the metaheaders plugin interacts with). Some of this per page meta data is used in the HTML meta headers, like title and author for example. Other data is however only used by DokuWiki internally for other functionality (like the backlinks for example). Also, there are plugins who use those .meta files to store additional information about their state, or other things they need at runtime.

The structure of the currently used meta elements can be found at http://www.dokuwiki.org/devel:metadata. I'm one of the maintainers of the meta plugin, but I haven't looked at the code in a while. It's been discussed to maybe massively change the whole per page meta data handling after the upcoming release so I haven't put that much work/attention on the plugin lately. But, IIRC the plugin only supports to set the values described at the page I linked above. It should probably be expanded to allow to set arbitrary meta keys.

Also, the mentioning of array values on the meta plugin page is missleading because the plugin doesn't support them.
Please add [SOLVED] to the initial thread subject if you feel your question has been answered.
If my answer doesn't make sense maybe your question didn't either - just visit http://facepalm.org.
Avatar
hemmerling #3
User title: Rolf Hemmerling, Germany
Member since Jul 2009 · 88 posts · Location: Hannover, Germany
Group memberships: Members
Show profile · Link to this post
Thanks alot.

Here is my "ultimate" file
<dokuwiki-root>/conf/metaheaders.conf.php

<?php
$headers['meta'][] = array( 'name' => 'DC.identifier', 'content' => '@ID@' );
$headers['meta'][] = array( 'name' => 'DC.creator', 'content' => '@AUTHOR@' );
$headers['meta'][] = array( 'name' => 'DC.date', 'content' => '@CREATED@' );
$headers['meta'][] = array( 'name' => 'DC.description', 'content' => '@ABSTRACT@' );
$headers['meta'][] = array( 'name' => 'DC.title', 'content' => '@TITLE@' );
$headers['meta'][] = array( 'name' => 'DC.relation', 'content' => '@RELATION@' );
$headers['meta'][] = array( 'name' => 'DC.contributor', 'content' => '@CONTRIBUTORS@' );
// end

causing this meta infos in the HTML file, for the main page "doku.php":

<meta name="DC.identifier" content="doku.php" />
<meta name="DC.creator" content="my name taken from the meta definition for plugin:meta" />
<meta name="DC.description" content="* [Array] first item * first sub item * second sub item * [Array] second main item * fist sub item * second sub item" />
<meta name="DC.title" content="my title taken from the meta definition for plugin:meta" />
<meta name="DC.relation" content="en:page1.html, en:page2.html, de:page3.html, de:page4.html" />
<meta name="DC.contributor" content="Official Dokuwiki username (first, lastname) of the user who created the page" />

while the contents of the page "doku.php" is
===== headline =====
  -first item
    *first sub item with link en:page1.html
    *second sub item with link en:page2.html
  -second item
    *first sub item with link en:page3.html
    *second sub item with link en:page4.html

Btw, the information about "DC.date" does not appear in the HTML-code, so obviously @CREATED@ is not set, and is **not** set by the meta tag

~~META:
title = my title taken from the meta definition for plugin:meta
&creator = my name taken from the meta definition for plugin:meta
&date created = 1961
~~

So how to set @CREATED@  ( if this is important at all?!!!??) ?

Sincerely
Rolf
This post was edited on 2009-12-07, 15:03 by hemmerling.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2018-09-23, 14:40:38 (UTC +02:00)