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.
| Comment | File | Size | Author |
|---|---|---|---|
| opengraph_meta.common.inc_.diff | 1.34 KB | maciej.zgadzaj |
Comments
Comment #1
maciej.zgadzaj commentedScratch second point, was a bit too hasty with it, just noticed that it breaks saving/updating... will need a different solution here.
Comment #2
hiddentao commentedI like these ideas. Will get them incorporated. Thanks for the patch.
Comment #3
hiddentao commentedAdded a new hook in latest dev release: og_tag_render_alter
Documentation in opengraph_meta_test_module.module
Comment #4
hiddentao commentedLooking 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.
Comment #5
hiddentao commentedComment #6
hiddentao commentedThe new hook will be incorporated into the next release.