- This patch firstly gets nodewords to use it's own hook to generate the metatags. This is just a cleanup of the code and means it's a more consistent implementation across multiple modules. It also means that nodewords_nodewords() can act as an example for other modules.
- Secondly it gives the hook_nodewords() function an operation called 'list' which lists the tags which become available from that module. This allows a module to define it's own metatags (like in our case, an AGLS module can define the tags for AGLS metadata). This is integrated into the nodewords API so that these can be selected/deselected from the metatags configuration page.
Together these changes mean I can do this (and define my own tags, with correct integration):
function funnelback_nodewords(&$tags, $op, $type, $ids) {
switch ($op) {
case 'list':
return array('Funnelback.og');
case 'prepare':
if ($type == 'node') {
$node = node_load($ids[0]);
$tags['Funnelback.og'] = (is_array($node->og_groups_both)) ? implode(', ', $node->og_groups_both) : 'Public';
}
break;
}
}
There are more patches I'd like to make, but getting this accepted would be a first step. Including moving the DC.title tag out into it's own local plugin (metatags/title.inc).
| Comment | File | Size | Author |
|---|---|---|---|
| nodewords_hook.patch | 2.08 KB | nterbogt |
Comments
Comment #1
Robrecht Jacques commentedI'll accept this patch. Will commit tomorrow (afk right now). A patch that splits out dc.title will be accepted too (metatags/DC.Title.inc).
Great work!
Comment #2
nterbogt commentedI think I'll hold off on the other patches because I just saw a post on your work on 2.x. I'll try to have a look at it later this week, and if possible, lend you a hand.
Until then, this patch is enough for me to implement what I need to.
Feature request: Can version 2.x support schema's for the meta tags? :)
Comment #3
Robrecht Jacques commentedCommitted to DRUPAL-5--1.x-dev. It will be included in the next release 5.x-1.10 later this week.
Thanks!
As for the feature request: yes or maybe :-)
6.x-2.x will support attributes on metatags. This means you will be able to configure it so you can output:
Why maybe? Because at the moment I'm not thinking about specific schema/schemes support (eg validation of the content). Also the attributes added to meta tags would be static, eg the same for each occurence of that specific attribute. This means that
scheme="DCTERMS.W3CDTF"would be added to every occurence of a specific meta tag. So there won't be a select box on the edit pages for choosing which scheme you are using...But there will be attributes support so in theory you can write your own proper DublinCore+Scheme module.
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.