It doesn't make sense to add meta tags to some content types, such as those that are not designed to be viewed by themselves—a slideshow slide content type or a personal bio that only ever appears in a view. Meta tags, if defined on these nodes, will never be output, so it's confusing to have the Meta tags fieldset in the edit form. I would like to see the ability to hide the fieldset on a per content type basis just like I do with menus.

CommentFileSizeAuthor
#20 metatag.patch874 bytesjax
#19 metatag.patch858 bytesjax

Comments

brunorios1’s picture

admin/config/search/metatags/config/add

traviscarden’s picture

Thank you @brunorios1. I can create per content type configurations from there, but if I can altogether disable meta tags for a particular content type or hide the node form settings it's not obvious to me how.

Kendall Totten’s picture

I agree, I also think the ability to customize the default tokens for the meta description & tags by content type would be helpful. For example I have a specific "news" content type that has a separate field for the node summary, and I'm not utilizing the default Body summary field. So I'd like to switch the token *only that content type* from [node:summary] to [node:field_front_page_teaser].
It would make sense to have these settings under Structure > Content Type > Name-of-Content-Type > Manage Fields > Meta Tags /Edit
Thank you for your work!!

traviscarden’s picture

Title: Enable Meta tags per content type » Show/Hide Meta tags fieldset per content type

I must not have been clear in my original description. I'm not talking about setting default values for meta tags on a content type basis (which, as @brunorios1 points out, can already be done from admin/config/search/metatags/config/add). I'm talking about hiding the whole fieldset on node edit forms of arbitrary content types.

mitch albert’s picture

subscribe

Anonymous’s picture

Title: Show/Hide Meta tags fieldset per content type » Configure Meta tags fieldset per content type
Version: 7.x-1.0-alpha3 » 7.x-1.x-dev

Modified the title slightly. I have a need for differing meta tag tokens for differing content types. For instance I've created a content type that has no body field so there is no node:body or node:summary for the token. Allowing the field modification delete for the content type could handle the original request of Showing/Hiding the Meta Tags field; I don't know how feasible/doable that is though.

pminf’s picture

I'm using the Entity Registrations module for event signup. Registrations are fieldable entities and meta tags are undesired visible in form. So it is necessary to hide those.

traviscarden’s picture

Title: Configure Meta tags fieldset per content type » Show/Hide Meta tags fieldset per content type

@ernie, if I read you correctly, what you're trying to do can already be accomplished by creating separate configurations at admin/config/search/metatags/config/add. I'm returning the issue title to the original.

Chaulky’s picture

This might be a duplicate of http://drupal.org/node/1429100

socialnicheguru’s picture

like in #7, I am using an entity and do not want the meta tag field set to show up.
this will also help reduce the page weight.
I am using the feedback module.

I went to admin/config/search/metatags
I disabled all of them.
the metatag field still showed up in the feedback box.

Why is that?

Chaulky’s picture

The settings at admin/config/search/metatags allow you to set custom settings for the meta tags on different entities, but disabling the configuration simply disables the custom settings; it doesn't disable meta tags on those entities.

socialnicheguru’s picture

so there is no "global disable"?

Chaulky’s picture

I haven't looked at the code to confirm, but I do not believe it can be completely disabled for any particular entity/bundle type.

dman’s picture

See here for a fix to the feedback problem, and a start at an explanation fo rhow entities can choose not to have metatags at all.
http://drupal.org/node/1543900#comment-6130492

However, it is a fair request that metatag should allow this option to be flagged from the metatag UI.

kevinquillen’s picture

Yes. There are content types or entities that need no meta data associated to them. I would like to disable them on a bundle basis too.

urbanbricks’s picture

Subscribe

Anonymous’s picture

@urbanbricks: Please stop doing the old style "subscribe" to follow an issue. Now there is the big "Follow" button to use so that we don't get 1000's of "subscribe" notices.

jax’s picture

Having same issue.

How about modifying metatag_entity_supports_metatags() to check if any configuration is actually enabled for the current bundle.

For example, if you have an Article node bundle you could check if there are settings for that specific bundle, if not for Node (that are enabled) and if not you check if Global is enabled. Does that sound like a valid approach and would that function the place to do it?

jax’s picture

Status: Active » Needs work
StatusFileSize
new858 bytes

A first version.

If there is no enabled config for the current entity:bundle just return false. Obviously this still needs some work to integrate cleanly but this works for node bundles.

An alternative would be to just add a metatag on/of checkbox on each bundle's settings form.

jax’s picture

StatusFileSize
new874 bytes

Added a little break to stop the foreach when it's no longer needed.

jax’s picture

Sorry for the spam, but yet another alternative would be that if a specific configuration for a entity/bundle combination is added but disabled that the form is not shown. That would leave the possibility to leave the node configuration enabled and just disable the metatag form for one content type.

jax’s picture

JvE’s picture

damienmckenna’s picture

Status: Closed (duplicate) » Active

Reopening.

@JvE: that issue is for controlling the meta tags per entity type, this is to control it per node entity bundle, which is not the same thing.

jax’s picture

Anyway, this seems to be fixed in the latest alpha. When you disable Global and Node and only leave per bundle settings the metatag fields only show up for those bundles.

JvE’s picture

Status: Active » Closed (duplicate)

Yes, this issue was solved by #1281770: Disable metatags by default on all entitity types, enable it only on needed and popular types - nodes, terms which was about more than just types but included bundles as well.

damienmckenna’s picture

Lets continue the discussion of disabling the output of specific meta tags in #1286270: Option to disable meta tags per entity/bundle/object.

damienmckenna’s picture

Issue summary: View changes

Updated issue summary.

pratip.ghosh’s picture

An alternate approach may be to use the form #after_build property.

$form['#after_build'][] = '_custom_afterbuild_callback';
function _custom_afterbuild_callback($form, &$form_state) {
  $form['metatags']['#access'] = FALSE;
}