Jump to:
| Project: | Open Graph meta tags |
| Version: | 6.x-1.5 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | fixed |
Issue Summary
Two small changes/additions would be great for this module and add more flexibility:
1) Invoke a hook at the end of get_og_tag_defaults() function, so that other modules would be able to update tag default values (which could still be changed if tags were defined for a specific node).
This way it would be easy to for example update default OG meta tags with those coming from Nodewords (or other similar modules), which currently is not easily achievable.
2) Change the way in which 'og:' prefix is added to field names - I understand that adding it in add_meta() call is the simplest one, still though would suggest removing it from there and adding to field definitions in constants.
This would resolve all fb:admins and fb:app_id issues, as they could be easily added through hook mentioned in 1) by any other module.
Diff with suggested changes attached.
| Attachment | Size |
|---|---|
| opengraph_meta.common.inc_.diff | 1.34 KB |
Comments
#1
Scratch second point, was a bit too hasty with it, just noticed that it breaks saving/updating... will need a different solution here.
#2
I like these ideas. Will get them incorporated. Thanks for the patch.
#3
Added a new hook in latest dev release: og_tag_render_alter
Documentation in opengraph_meta_test_module.module
/**
* Implements hook_og_tag_render_alter().
*
* @param $node the node whose tag is being rendered.
* @param $name the name of the OG tag being rendered, e.g. title, image.
* @param $value the value of the OG tag being rendered.
*
* @return the altered value to render for the given tag.
*/
#4
Looking back at this issue I'm not keen on adding the 'og:' prefix in the class constants because they get re-used when reading/writing field names from/to the database too. Perhaps it can be configured as a Drupal variable if needed, though at the moment I don't see the OG standard changing its prefix any time soon.
#5
#6
The new hook will be incorporated into the next release.