[pmwiki-users] Added meta tags and schema.org microdata injection into pages

kirpi at kirpi.it kirpi at kirpi.it
Mon Oct 3 08:18:46 CDT 2011

> You'll have to write a markup rule and a function; The markup rule
> calls the function and passes arguments for it ; Inside the function
> you'll have to use the function called ParseArgs and then format the
> arguments with the meta html markup you want; Last step is to assign
> it to $HTMLHeaderFmt['facebookmeta'] - that has to be set as global
> inside the function- and voilà! :-)

Et voilà! ...you say :-)
Ehhmm... well...

Carlos, really thank you for your hints: I failed to understand both
the technical jargon and to translate it into working code.
I then tried to directly lift some code from /scripts/stdmarkup.php
but there also I failed.
It is all too advanced for me: I'm just at a copy-and-paste level,
more or less :-)
All those \/\'ie?($){*/'}... bleah!
:-) Impossible to undertand.

I think I will try this (plainer) way:
1) Place something like the following into the skin template, into the
html head section:
   <html itemscope itemtype="http://schema.org/Article">
   <meta itemprop="name" content="{$Title}" />
   <meta itemprop="description" content="{$Description}" />
   <meta itemprop="image" content="{$:Image}" />
   <meta property="og:title" content="{$Title}"/>
   <meta property="og:image" content="{$:Image}"/>
   <meta property="og:description" content="{$Description}"/>

2) Place (and fill) something the like into every page
   (:title This is the title of the page:)
   (:Description Some text:)
   (:Image:http://www.example.com/image.jpg"something about this image":)

It will probably work.
Will try tonight and let you know.


As a separate comment (and general consideration), it seems to me that
having, on any single web page, something like
   <meta name='description' content='Some text' /> <!-- standard -->
   <meta property="og:description" content="Some text"/> <!-- Facebook -->
   <meta itemprop="description" content="Some text" /> <!-- Google -->
is a bit too redundant. Yet it probably is something we cannot avoid
if we want to properly adopt those social buttons from Facebook and
Google+ (there is something else also for Twitter and more...)
And the makup is going to go wilder in the next future, probably :-|
"Semantic web", I've heard saying, plus a bunch of big companies
trying to establish/force their own preferred choices.
There are pros and cons in the whole thing, yet it cannot be ignored,
as it also involves better search engines ranking and listing.

Here is why I'm trying to expose the issue to the pmwiki community.


More information about the pmwiki-users mailing list