MidCOM 2.5, metadata and "the main object"
Henri Bergius <henri.bergius-ZpG/[email protected]>
| Newsgroups | gmane.comp.web.midgard.devel |
|---|---|
| Message-ID | <[email protected]> |
Greetings!
The latest wisdom for making well-performing MidCOM components is to
populate NAP leaves from only the items that you absolutely want to
make available to the site navigation. This means some things like
changing between views of a component ("account details", "change
password"), or navigation in simple content-oriented components like
taviewer.
Since the rest of the components (including components like
newsticker and photos) will not be using NAP for their contents, they
must make MidCOM aware of what URL contains what content in other ways:
* Component interface class should resolve permalinks to views by
implementing the _on_resolve_permalink() method
* Page titles should be registered using the $_MIDCOM->set_pagetitle
() method
* Toolbars can be registered into the midcom_helper_toolbars static
toolbar list (there are two toolbars relevant to components: "top"
and "bottom" that practically replace the old NAP toolbar for
switching between states)
However, this leaves one important aspect out of question: metadata.
Since there is no active leaf selected, MidCOM's metadata system will
not be able to provide information like "last updated" and "page
author" into metatags.
I would propose to add another method to $_MIDCOM for registering the
"main object" of a view as the object where metadata should be
derived from. Something like:
$_MIDCOM->set_metadata_object($article);
This method should be called in component's handle phase, and the
MidCOM metadata system should then utilize the $_MIDCOM->add_meta_head
() method to populate appropriate information to all regular pages.
The information should by default at least include:
- Title of the main object as "dc.title"
- User who created the main object as "author" and "dc.creator"
- Initial creation date of the main object as "dc.date"
- Latest editing date of the main object as "lastupdated"
- Metadata keywords and summary of the object (if provided)
- PermaLink URL to the page as a "rel bookmark" link
In addition, it would be nice to display some information about the
software setup. Something like:
- Component handling the main view (name and version) as
"midcom.component"
- Generator of the page (Midgard, MidCOM and PHP versions) as
"generator"
At the moment midcom-template handles this metadata population, and
displays something like the following:
<link rel="bookmark" href="http://bergie.iki.fi/midcom-
permalink-1c8e36dd7a43d34868de8d04ce5b5bd4" />
<meta name="generator" content="Midgard/1.6.3/Repository MidCOM/2.4.6
PHP/4.3.10-15" />
<meta name="midcom.component" content="de.linkm.newsticker" />
<meta name="midcom.application" content="midcom-template/2005.07.27" />
<meta name="dc.date" content="2005-08-29" />
<meta name="dc.creator" content="Henri Bergius" />
<meta name="author" content="Henri Bergius" />
<meta name="dc.title" content="Posting pictures from iPhoto to
Midgard" />
<meta name="lastupdated" content="2005-08-29" />
As m-t is going away soon, we must have a proper measure to replace
it. Good meta tags are important for search engine ranking and
machine-readability of the page.
/Bergie
Henri Bergius
Consultant Partner, Nemein
henri.bergius-ZpG/[email protected]
Midgard CMS
www.midgard-project.org