It would be great if you could just turn off the admin UI for metatags on a per entity type and/or bundle basis. The fieldset to specify metatags on an entity edit form is pretty heavy. We've found it helpful to prevent metatag from adding the fieldset. Metatag doesn't provide a way to turn the Admin UI off, while leaving the config enabled. This is also handy b/c for some entity bundles, you really don't want editors changing things here, plus if a metatag config for an individual entity gets saved, you loose the ability for changes in the defaults to have an effect on it.
Going to create a quick patch to give you an option to set a variable to turn this off. Would probably also be handy to expose this variable in Advanced settings it there is interest.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | metatag-n2508363-11.patch | 1.91 KB | damienmckenna |
| #5 | disable_admin_ui-2508363-4.patch | 1.91 KB | m4olivei |
Comments
Comment #1
m4oliveiHere's a basic patch that works. Allows you to define a variable of the form:
metatag_enable_ui_{$entity_type}__{$bundle} metatag_enable_ui_{$entity_type}To disable the admin form for a particular entity type and/or bundle, just set this var to FALSE, it defaults to TRUE. eg.
Comment #2
damienmckennaYou can already disable the fields for different entities via the settings page, so this would be duplicate functionality.
Comment #3
m4olivei@DamienMeKenna if you disable the field for the bundle on the settings page, it will disable the metatag config for that bundle as well as the admin form right? In our case, we wanted to disable just the admin form to save bloat on the form and to avoid a scenario where values were saved inadvertently for an entity, which then overrides the default metatag settings.
Here is an updated patch against 7.x-1.7, which we are currently testing.
Comment #5
m4oliveiOops, didn't make that patch relative. Updated.
Comment #6
damienmckennaComment #8
damienmckennaThis should follow the logic currently used for the other functionality, and provide options on the settings form.
Comment #9
damienmckennaFYI the D8 branch works in the opposite direction - the site builder has to manually add the form field to entity bundles where the fields should be visible, rather than adding it everywhere.
Maybe you should just update to D8? ;-)
Comment #10
damienmckennaIt's also possible to use hook_form_alter() to set $form['metatags']['#access'] to FALSE as needed.
Comment #11
damienmckennaHere's a quick reroll of the patch from #5, no other changes were made.
Comment #12
damienmckennaBack to Needs Work.
Comment #13
damienmckennaComment #14
bluegeek9 commented