DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:meta

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:meta [2015-07-25 12:35] – [Discussion] 109.221.118.231plugin:meta [2022-09-08 17:52] (current) – [Meta Plugin] fiwswe
Line 2: Line 2:
  
 ---- plugin ---- ---- plugin ----
-description: Set Metadata for the current page(previous authors: Esther Brunner, Gina Häußge, Michael Klier) +description: Set Metadata for the current page 
-author     : Michael Hamann +author     : Dokufreaks (previous authors: Michael Hamann, Esther Brunner, Gina Häußge, Michael Klier) 
-email      : michael@content-space.de+email      : freaks@dokuwiki.org
 type       : syntax type       : syntax
-lastupdate : 2015-07-24 +lastupdate : 2021-10-16 
-compatible : Weatherwax, Binky, Ponder Stibbons, Hrun+compatible : Weatherwax, Binky, Ponder Stibbons, Hrun, Frusterick Manners, Greebo, Hogfather, Igor
 depends    :  depends    : 
 conflicts  conflicts 
-similar    : +similar    : metaeditor, metaheaders, htmlmetatags
 tags       : meta, !experimental tags       : meta, !experimental
 downloadurl: https://github.com/dokufreaks/plugin-meta/tarball/master downloadurl: https://github.com/dokufreaks/plugin-meta/tarball/master
Line 17: Line 17:
 ---- ----
  
-^  :!: [[:experimental]] :!:  ^+ 
 +:!: [[:experimental]] :!:
  
 ===== Description ===== ===== Description =====
  
-This [[plugins|plugin]] allows you to set [[:metadata]] for a page. This is useful for overriding default [[:DokuWiki]] metadata, for example if you want to display someone else than the user who pasted the text into the wiki as the author of a [[blog]] entry.+This plugin allows you to set [[:metadata]] for a page. This is useful for overriding default [[:DokuWiki]] metadata, for example if you want to display someone else than the user who pasted the text into the wiki as the author of a [[blog]] entry.
  
 ===== Syntax ===== ===== Syntax =====
  
-| ''%%~~META:%%//key//=//value//%%~~%%'' |+  ~~META: 
 +  key = value 
 +  ~~ 
 + 
 +^ key    | the metadata element to set  | required | 
 +^ value  | the metadata element content | required |
  
-''//key//''    | the metadata element to set  | required | +You can set more than one element at once by using an ''&'' delimiter. Further, to set a child element, separate key and subkey with a space. Additional whitespace is allowed. Dates should be entered in the form ''YYYY-MM-DD hh:mm:ss''. Two dates with an arrow (''%%->%%'') in between are considered as a period.
-''//value//''  | the metadata element content | required |+
  
-You can set more than one element at once by using an ''&'' delimiter. Further, to set a child element, separate key and subkey with a space. Additional whitespace is allowed. Dates should be entered in the form ''YYYY-MM-DD hh:mm:ss''. Two dates with an arrow (''%%->%%'') in between are considered as a period. An example:+==== An example ====
  
   ~~META:   ~~META:
Line 60: Line 65:
 ===== Bugs / Feature Requests ===== ===== Bugs / Feature Requests =====
  
-Please report bugs or feature requests at the [[http://github.com/dokufreaks/plugin-meta/issues|Bug tracker]].+Please report bugs or feature requests at the [[https://github.com/dokufreaks/plugin-meta/issues|Bug tracker]].
  
 ===== Further Resources ===== ===== Further Resources =====
  
-  * [[http://github.com/dokufreaks/plugin-meta/tree/master|Git Repository]] +  * [[https://github.com/dokufreaks/plugin-meta/tree/master|Git Repository]] 
-  * [[http://github.com/dokufreaks/plugin-meta/issues|Bug Tracker]]+  * [[https://github.com/dokufreaks/plugin-meta/issues|Bug Tracker]]
  
 ===== Changes ===== ===== Changes =====
Line 96: Line 101:
  
 Hi, I don't get the Plugin to work.[...].--- //This comment 2008-05-05 by ''david''// Hi, I don't get the Plugin to work.[...].--- //This comment 2008-05-05 by ''david''//
- +>I found the Error myself. It was a outdated Template that I used. ;-)--- //This comment 2008-05-05 by ''david''//
-I found the Error myself. It was a outdated Template that I used. ;-)--- //This comment 2008-05-05 by ''david''//+
  
 It did not work on my site (latest release - incognitek template), it did not change my pages ... How can I proceed to see what's wrong ? //This comment 2008-11-01 by ''Julien''// It did not work on my site (latest release - incognitek template), it did not change my pages ... How can I proceed to see what's wrong ? //This comment 2008-11-01 by ''Julien''//
 +> It does work right now. Is it still wrong for you ? // Olivier Humbert - 2015-07-25 12:33 //
  
 I wonder how to make the array definitions - is there a bug or am I doing something wrong? I tried it in PHP style because the source looked as it would be treated that way: I wonder how to make the array definitions - is there a bug or am I doing something wrong? I tried it in PHP style because the source looked as it would be treated that way:
Line 109: Line 114:
 > This is not how this was supposed to work, now you can use ''%%~~META:relation haspart=testpage~~%%'' and the plugin will automatically determine if the page exists and set the metadata appropriately.  --- [[user>Michitux|Michael Hamann]] //2015-07-24 21:50// > This is not how this was supposed to work, now you can use ''%%~~META:relation haspart=testpage~~%%'' and the plugin will automatically determine if the page exists and set the metadata appropriately.  --- [[user>Michitux|Michael Hamann]] //2015-07-24 21:50//
  
-=====How-to-use-the-Plugin =====+Hi, i want to set keywords for the searchengines but it do not work ... only change the META:title will work. 
 +\\ What will be wrong? 
 + 
 +  ~~META: 
 +  title      titletext 
 +  &keywords   keyword1 keyword2 keyword3  
 +  &audience   alle 
 +  &page-topic topic of the pages 
 +  ~~  
 +  
 +//This comment 2016-01-02 08:08 by ''Wolf''// 
 + 
 +===== Simple patch that allows to use Metadata in your pages ===== 
 + 
 +<code diff> 
 +--- syntax.php.orig 2019-08-15 16:10:59.057459368 -0400 
 ++++ syntax.php 2019-08-16 02:29:46.258100543 -0400 
 +@@ -43,4 +43,6 @@ 
 +     function render($mode, Doku_Renderer $renderer, $data) { 
 +-        if ($mode == 'xthml') { 
 +-            return true; // don't output anything 
 ++        if ($mode == 'xhtml') { 
 ++            global $ID; 
 ++            foreach($data as $key=>$value)  
 ++                if($key && (!$value or is_array($value) && !current($value))) $renderer->doc .= strtr(p_get_metadata($ID, $key.' '.($value?key($value):'')), $data[(string) NULL]?:array());  
 +         } elseif ($mode == 'metadata') { 
 +@@ -89,3 +91,3 @@ 
 +                     // no special treatment for the rest 
 +               } else { 
 ++                } elseif( $key && $value ) { 
 +                     $renderer->meta[$key] $value; 
 +</code> 
 + 
 +Now you can put to your pages something like: 
 +  My creator is ~~META:creator~~! 
 +  ~~META:creator 
 +  & superadmin=Yay, page created by superadmin! 
 +  & shyuser=Oh, page created by very modest user.. 
 +  ~~ 
 + 
 +And don't forget that DokuWiki allows you to store any custom Metadata! 
 + 
 + --- [[user>annelin|ann. / OÜ Narayana]] //2019-08-16 06:55// 
 + 
 +===== How to use the plugin ===== 
 + 
 +Please read http://forum.dokuwiki.org/post/15988 about how to use the plugin. //[[hemmerling@gmx.net|Rolf Hemmerling]] 2009-12-05//
  
-Please read 
-http://forum.dokuwiki.org/post/15988 about how to use the plugin. //[[hemmerling@gmx.net|Rolf Hemmerling]] 2009-12-05// 
plugin/meta.1437820505.txt.gz · Last modified: 2015-07-25 12:35 by 109.221.118.231

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