The include files used to handle the meta tags should be allowed to handle more than one meta tag; rather than having a separate file for each Dublin Core meta tag, i.e., this would allow all the Dublin Core metadata to be handled by a single include file.

Comments

avpaderno’s picture

Title: Add support for more than one meta tag for include file » Add support for more than one meta tag per include file

I am fixing a bug in the report title.

Robrecht Jacques’s picture

You could let the nodewords_<filename>_info() return an array of (info-)arrays for each of the tags the .inc file supports. You probably then need a "basename" (already present) or have a "settings", "prepare", ... callback so tags inside the same .inc could share functions.

You could also probably make _nodewords_get_possible_tags() invoke a hook (hook_nodewords_list_tags() ?). This hook would return the info arrays for each possible tag another module implements - this way people can add own tags without having to place a .inc inside the nodewords directory (which could make updates easier if you have custom code). The .inc files would then be read in the hook_nodewords_list_tags() implementation of nodewords itself... or rather, they would be read in _nodewords_get_possible_tags() as now.

My € 0.02

avpaderno’s picture

Title: Add support for more than one meta tag per include file » Change the way the list of supported meta tags is created
Category: feature » task

I agree.
What I would exactly do is to:

  • Change _nodewords_get_possible_tags() to get the list of the implemented tags from hook_nodewords_tag_list_alter(), which would allow third-party modules to alter the list of implemented tags, or to add new meta tags in the list; the hook would use an array containing the same information given now from nodewords_<metatag>_info() function, with the difference that basename would return the first part of the name of the functions that handle the meta tag (for the description meta tag, this would be nodewords_description_, i.e.). This would allow the code to not have the limit of a single meta tag described in an include file; where the functions handling the meta tags are located is a detail that only the implementing module must know, but it's not an information that Meta tags really needs.
  • Meta tags implements hook_nodewords_tags_list_alter() too; the hook must load the include file that contain the definition of the meta tags (there is not anymore the need of a single file for each meta tag, but the functions handing the meta tag should still be kept separated from nodewords.module).

I am changing the report metadata.

avpaderno’s picture

Having the meta tags list created in this way would allow the list to dynamically change basing on conditions that are verified at runtime. In example, a module could list a meta tag only if a third-party module is enable; in the case the third-party module is not enabled, it would return a list of meta tags that contains less meta tags.

avpaderno’s picture

Status: Active » Fixed

This has been implemented, and the code committed in CVS.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.