Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Lots of good stuff comes from supporting Entity module's property info, but the main one for me is that some code I'm writing now and get and set the metadata of a node programmatically nice 'n' easy!
Patch to follow.
Comment | File | Size | Author |
---|---|---|---|
#9 | metatag-n1817620-9.patch | 2.4 KB | DamienMcKenna |
Comments
Comment #1
jamsilver CreditAttribution: jamsilver commentedPatch attached.
Comment #2
jamsilver CreditAttribution: jamsilver commentedAh OK - here's one which has sensible descriptions on the properties.
Comment #3
jamsilver CreditAttribution: jamsilver commentedAnd finally - one that actually works =p
Comment #4
DamienMcKennaInteresting idea. Could you please extend this to at least cover all of the meta tags from the main module? Thanks.
Comment #5
Dave ReidYeah, this cannot be committed as-is having the list of meta tags hardcoded. This needs to retrieve available meta tags from the API.
Comment #6
tauno CreditAttribution: tauno commentedRe-worked to not hardcode the list of metatags that are available. One @todo is noted in the patch still. The property is being added to all entities instead of just entities where metatags are enabled because metatag_entity_supports_metatags() isn't returning the correct result inside metatag_entity_property_info_alter().
Needs more work.
Comment #7
DamienMcKennaComment #8
DamienMcKennaRerolled. Should this be moved into a separate file?
Comment #9
DamienMcKennaDoes this work too?
Comment #10
DamienMcKennaNeeds to be updated to check against metatag_entity_supports_metatags().