Closed (fixed)
Project:
Nodewords: D6 Meta Tags
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
1 Jun 2009 at 19:37 UTC
Updated:
16 Jun 2009 at 09:30 UTC
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
Comment #1
avpadernoI am fixing a bug in the report title.
Comment #2
Robrecht Jacques commentedYou 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
Comment #3
avpadernoI agree.
What I would exactly do is to:
_nodewords_get_possible_tags()to get the list of the implemented tags fromhook_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 fromnodewords_<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 benodewords_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.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.
Comment #4
avpadernoHaving 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.
Comment #5
avpadernoThis has been implemented, and the code committed in CVS.