As a continuation of #1281770: Disable metatags by default on all entitity types, enable it only on needed and popular types - nodes, terms (I hate reopening old issues), the only entities that should have Metatag enabled should be ones that are known to work, it should be otherwise disabled by default.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | metatag-n1846080.patch | 4.99 KB | damienmckenna |
Comments
Comment #1
damienmckennaTag.
Comment #2
caschbre commentedJust to provide an example where I'm running into the issue of metatags showing up on entity/bundles where they are not necessary...
I'm using fieldable_panels_panes and noticed that all of my bundles have the metatag field on the 'manage display' tab. There probably isn't a reason to have metatags there and I'm not quite sure how to remove them.
So my question is how would I remove them with code? I'm defining my bundles in code so I can easily remove the metatag the same way.
Ideally we'd provide a UI mechanism, but for now the code method would suffice.
Comment #3
damienmckennaI'm going to change metatag_entity_info_alter() and metatag_entity_supports_metatags() so they will be opt-in rather than opt-out.
Comment #4
damienmckennaThis should do it.
This patch updates metatag_entity_info_alter(), removes all logic from metatag_entity_supports_metatags() that tried to determine whether an entity was Metatag-worthy and instead will only deem the entity_type/bundle compatible if specifically assigned. I've also added example code to the API docs for how to enable Metatag support in new entities, and added a note to the README.txt file about it too.
In my testing this did not make any difference when just using Drupal core, but I did not see any ill effects with Field Collection.
Comment #5
caschbre commentedThanks! I'll give this a try later today.
Comment #6
caschbre commentedLooks good so far. Metatags no longer appear on my fieldable_panels_panes and are still available on my nodes.
Comment #7
damienmckennaCommitted.
Comment #9
sk2013 commentedI have a quick question... and I am really thankful for any pointers:
I do not want to show the Meta Tages fields on certain content types. ( Totally not want to show).. Will this patch help me to fix the issue currently I am having? Or is there any alternative approach to disable Meta tag fields to some content types?
Thanks for the help,
Senthil
Comment #10
mrpauldriver commentedFurther to #9.
Please could someone confirm whether there is now a simple way to disable metatag per content type?
There seem to have been a number of similar issues and it has all become a bit confusing.
Comment #11
JvE commentedSince "content-type" equals "bundle" for entities of type "node" this functionality is requested in #1286270: Option to disable meta tags per entity/bundle/object.
Comment #12
mrpauldriver commentedThank you. As well as adding to my grasp of Drupal terminology, this also gets me on the right issue for now :-)
Comment #13
sk2013 commentedHi JvE,
Can you confirm the patch that works for the scenario? I am quite confused.
Thanks
Comment #14
JvE commentedThere is no working patch for this. It is not possible to disable metatags for content-types without writing your own module.
See this issue comment for an example. I don't know if that code is still valid though.
Comment #15
damienmckennaPlease move all discussion to #1286270: Option to disable meta tags per entity/bundle/object.