dokufreaks / plugin-meta Goto Github PK
View Code? Open in Web Editor NEWHome Page: http://dokuwiki.org/plugin:meta
Home Page: http://dokuwiki.org/plugin:meta
An error of "argument 1 is not an array" is displayed when trying to set the description abstract meta data and the meta data is not set.
The problem is explained at http://php.net/manual/en/function.array-merge.php - "The behavior of array_merge() was modified in PHP 5. Unlike PHP 4, array_merge() now only accepts parameters of type array. However, you can use typecasting to merge other types.".
The solution is to change line 91 in syntax.php from
array_merge($renderer->meta[$key], $value);
To
array_merge((array)$renderer->meta[$key], $value);
PHP Fatal error: Uncaught Error: Call to protected method Doku_Renderer_metadata::_firstimage() from context 'syntax_plugin_meta' in /var/www/html/dokuwiki/lib/plugins/meta/syntax.php:75
Points to: $renderer->_firstimage($subvalue);
PHP v7.3.14-1~deb10u1
I can comment out this line as I do not change relation firstimage anyway, and everything seems to work.
Latest version correctly sets all but the date in the following example:
~~META:
title = Example
&creator = AUTHOR
&date created = 2014-12-03
&description abstract = This is a test
&source = http://www.example.org/
~~
Replaced syntax.php
with 2015-07-24 version and all works as expected.
Dokuwiki Release 2018-04-22a "Greebo"
meta plugin Installed version: 2015-07-24
Issue: meta plugin does not set metadata as expected
Example: https://openwrt.org/toh/views/toh_dev_arch-target-cpu
pagesource:
~~META:
name="robots"
&content="noindex,nofollow"
~~
html:
<meta name="robots" content="index,follow"/>
-> The metadata added to the page does not have any effect on the html.
Am I using the plugin incorrectly or is this a bug?
โฆ/data/log/deprecated/*.log shows entries such as this:
2022-09-06 13:28:11 syntax.php is deprecated. It was called from require_once() in /dokuwiki-test/lib/plugins/syntax.php:3 Do not require() files yourself. Autoloading should be used instead!
A grep over the plugins folder turned up this which I suspect is one of the causes of the message:
/var/www/dokuwiki-test/lib/plugins/meta/syntax.php:require_once(DOKU_PLUGIN.'syntax.php');
See: https://github.com/dokufreaks/plugin-meta/blob/master/syntax.php#L10
Commenting the line seems to solve the issue.
fiwswe
I needed to set the value of the "abstract" meta property and reference it from within the DIR plugin, something that seemed workable. I spent almost all day researching Dokuwiki's meta-data structures, experimenting with plugin-meta syntax and single-stepping through the plugin-meta code to finally discover that [1] the "abstract" meta-property is a "subkey" of the "description" meta-property and [2] the plugin-meta syntax for subkeys is untouched by its documentation. I finally discovered the proper syntax and was able to make the META and DIR plugins work together as desired. Whew.
I'm not complaining about the time because it was a geeky challenge and I learned a LOT, but this plugin's documentation should be more complete because not everybody has the time, developer background or software tools required to do what I did. I created my own account on dokuwiki.org thinking I could update the plugin-meta documentation with what I learned, but getting normal dokuwiki.org credentials doesn't give editing rights. Sigh.
Other points:
description
of a page is internally its abstract
, and the abstract
is a subkey of description
in the minds of Dokuwiki and plugin-meta. By default, abstract
is preloaded with the first 250 characters of the page content after every edit UNLESS plugin-meta has declared another value (which is what I was trying to do).description abstract = [your-text]
(not including the preceding "&" if the line is not the first in the ~~META
declaration).I would be happy to augment the documentation myself if I had a way to do that, obviously in collaboration with the plugin author/maintainer. I envision adding a table of examples to document the full spectrum of all the settable metadata properties (which is a small subset of all the properties which actually exist within Dokuwiki).
I wish I had time, now that I know more about how this plugin works, to offer some help with the code. That's another issue for another day. Sigh.
I like this plugin and I'm very happy it exists. Let me know how I can be involved in at least improving the documentation. Thanks.
Could someone update this plugin for its functionality in DokuWiki Hogfather?
Much appreciated in advance
Hi, and thanks for this plugin !
I use it for displaying news of the dokuwiki with blog and tag plugins, and they work perfectly after modifying the meta balise from the classical editor of dokuwiki. However, when I change metadata with unix console (with sed), changes not appear in the blog page, when I clean the cache or not. The modification appear if only I open the page out of the blog page.
How can I actualize metainformation after changing pages from console ? It's usefull for maintenance.
Best regards,
Thibaud.
Hi! It's not workable, I add
~~META:
title = My text
~~
And nothing happens- this code displays on page. Please fix problems! I can't find analogue of this plugin for setting up title on my pages!
P.S. Dokuwiki 2012-01-25 "Angua"
What I'm trying to achieve is to set up (a bunch of) pages with some tags, and then have another page listing all the pages containing one tag.
For that, I'm using the plugins TAG ([https://www.dokuwiki.org/plugin:tag]), PAGELIST ([https://www.dokuwiki.org/plugin:pagelist]) and META ([https://www.dokuwiki.org/plugin:meta]).
The plugin META is used in the hope to get exactly what I want (not the 200 or something first characters of a given page) in the list.
So I did put this META : ~~META:description abstract=blablabla - exactly what I want to be displayed in the Description field of the list - blablabla.~~
But the list still doesn't show my "description" field in the list.
I did play around that a bit for the last 2 days and found a workaround consisting of using another plugin : METAEDITOR ([https://www.dokuwiki.org/plugin:metaeditor]). The trick is to create a persistent key : description -> abstract (and leave it empty)
Then, The description field is shown as expected.
So the good thing is : that works as a workaround \o/
An the less-good thing is : that works as a workaround ... meaning that I would need to create this empty key for every page (hundreds of them) :/
Any help would be much more appreciated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.