Thanks for the good work on this module. However, I missed the auto-generation capabilities of Nodewords, and I now learn that some work-around has been suggested here: http://drupal.org/node/1134192 which for some reason, doesn't work for me despite following the steps correctly (I patched token module, specified a field token as default for a meta field, but I only get
<meta content="[node-field-xxx]".....>, instead of the replaced field values).

Meanwhile, I went ahead and created a stand-alone module which offers an admin settings page similar to Nodewords. With this, auto keywords vocabularies can be defined. Global keywords and content-type-specific default keywords can be specified. Auto-generation of meta description content can be specified, including the choice of source. Based on these settings, the module adds necessary meta content to the nodes.

The module is attached. I would be happy to rewrite it as a patch for metatags_quick if that would be useful. Pls let me know.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

valthebald’s picture

Seems like a niche solution for me. I hope token patch used in #1134192: Support for tokens in meta tag field values will find its way into official release in the future

ravi_sam’s picture

Thanks for the reply. I could not have my taxonomy terms in the keywords despite the token patch, and I think the following lines in metatags_quick.module are the reason:

       _metatags_quick_add_head(array(
          'name' => $item['meta_name'],
          'content' => $item['metatags_quick'],
        )); 

Changing them as below, seems to help:

       _metatags_quick_add_head(array(
          'name' => $item['meta_name'],
          'content' => $item['metatags_quick'],
          'type' => $object_type,
          'entity' => $object
        )); 

Still, I had to play around to get the exact token. [node:field-name] did not work, and after some experimenting, I figured out that [node:field-name:term:name] gave the required result.

Given the above complexities, I feel that the configurable auto tagging feature might simplify the usage a bit (especially for newbies). Also, it helps when there are hundreds of existing nodes which are not already meta tagged.

Andrew Schulman’s picture

I haven't tried ravi_sam's module, but +1 on the need for a place to set global default metatags. For my site, that's really all I want - just one place to set metatags for everything, and be done. For larger sites, it's infeasible to set metatags individually on all of the existing nodes.

There should also be separate permissions for viewing metatags in the edit form, and for editing metatags (different from the current "Edit metatags", which only restricts editing path-based metatags). This would allow administrators to set metatags globally for the site, and then hide the details from users.

valthebald’s picture

Version: 7.x-2.0 » 7.x-2.x-dev

Obviously, there is demand for simplifying mass tags administration.
Please look at another suggestion on at #1247318: Metatags GUI

Fanaile’s picture

I'm finding this little addon to be very useful, but I am wondering if there is a possibility of adding more token support?

Primarily, I am working on a site with more than 30,000 active members blogging - I would like to include their author name in the keywords if possible. So I have the global keywords (site name and slogan), auto keywords from the vocabularies used for blog entries (there are two, one structured and one free-tags), and for the default I would like to add the token in for the author name and possibly the title?

valthebald’s picture

#5: I think this should be rather posted in #1134192: Support for tokens in meta tag field values

ravi_sam’s picture

My understanding of #5 is that token support is requested for the 'little addon' that I've attached in my original post. I've gone ahead and done the following:
- added token support for all the text inputs (default and global keywords)
- rewritten my code as a patch on top of metatags_quick 7.x-2.x-dev. This might make it easier to test / reverse it, and probably integrate it into the next release of this module.
The (-p1) patch is attached for review.

valthebald’s picture

Issue tags: +gui

Probably separate helper module inside metatags_quick project (similar to views/views_ui separation) is not a bad idea, and it's fine to leave it as is?

TravelTechie’s picture

I tried installing the metatags_quick_auto_settings patch, but cannot get tokens [node:field-tags] or [node:field_tags] to work in either the path-pased description meta or the regular description meta fields. Not sure where to go from here.
I have tokens beta 4 and have confirmed that it is working.

runeasgar’s picture

subscribe

ravi_sam’s picture

FileSize
3.38 KB

#8: Sure, sounds good to me. So, here's the revised module with token support added.

#9: If you have enabled the 'auto settings' feature (either using the earlier patch or using the module attached with this comment), you don't need to use tokens to add taxonomy keywords. E.g for your requirement, you can check the 'Tags' vocabulary under 'Auto keywords vocabularies' in the auto settings page, and have the desired result. Also, as mentioned in #2 above, you might get the token working with [field_tags:term:name] though I'm not sure about that.

TravelTechie’s picture

Thank you for the input. I have gotten the meta keywords working for the taxonomy terms with the auto settings, however not for the meta description tag. I selected use node teaser or node body for meta description tag. Neither is working. I don't think I should have to but do I need to enter a token or is my token API just bugged?

davemybes’s picture

Status: Active » Reviewed & tested by the community

The new module works great, thanks! Auto-keywords, global keywords and content type specific keywords were tested and work as expected. Auto description works for nodes too, however, if you had a description manually entered before and then delete it, leaving an empty field, the auto-generation doesn't kick in. Not sure if this is the desired behaviour.

Fanaile’s picture

@ravi

Yes, you understood me perfectly and thank you so much for doing all this. I greatly appreciate it. You are the personification of why I tell my clients that the Drupal community rocks all others straight out of the field.

:)

valthebald’s picture

Status: Reviewed & tested by the community » Fixed

I have committed (with very minor modification) patch from #7 to 7.x-2.x
However, there are several problems that we need to solve before going 7.x-2.1:
1. with another committed patch (#1247318: Metatags GUI) admin interface is too bloated. Part of functionality has to go to extra module(s). First spin-off functionality candidate - import from nodewords. It's one-time operation, after which module can be switched off. Other suggestions?
2. auto settings support only keywords and description tags. It would be nice to make this functionality more generic.

TravelTechie’s picture

Just thought I wold comment here. I had the patch from #7 installed and mostly working, but ran into problems and had to reinstall everything. When I reinstalled the metatags_quick 7.2.x I did not see the patch from #7 incorporated into the new module as mentioned in #13. I was also not able to reinstall the metatags_quick_auto_settings. Maybe this is an issue on my D7 install, but I thought I would just mention it if anyone else was having the same problems.

ravi_sam’s picture

Status: Fixed » Patch (to be ported)
FileSize
3.36 KB

#15: Thanks for committing my patch into 7.x-2.x-dev. I have included a few minor bug fixes and also addressed the issue mentioned in #13, in the patch attached with this comment. Reg. the 2.1 version, I am open to suggestions as well, to address the admin bloat. I will also explore adding support for more meta tags such as copyright, robots, etc.

#13 & #14: Thanks for the review and encouragement :) The patch with this comment addresses the empty meta description issue.

#16: As clarified to you over email, you may download the latest dev release and check it out.

ravi_sam’s picture

Following detailed feedback received from 'trumbk' over emails, I was able to uncover some bugs which might affect some installations. I am attaching a bug fix patch for the same. It is to be applied on the current HEAD revision of 7.x-2.x-dev.

valthebald’s picture

What is the reason for using summary instead of safe_summary, and value instead of safe value?
Also, please check the rules for code formatting http://drupal.org/coding-standards. Coder module can help a lot.
Otherwise, patch looks fine, and I apply it to 7.x-2.x-dev.

ravi_sam’s picture

Thanks for the commit.

Reg. 'safe' values, I was wondering if they might not be available under certain conditions. I had requested Kurt (trumbk) for a var dump of the $node variable on his site, and the safe values were missing in it. I am not sure what could be the reason.

Sorry about the formatting issues. One specific block was looking funny in my Eclipse, though it appears ok in a standard text editor.

valthebald’s picture

Status: Patch (to be ported) » Fixed

Automatically closed -- issue fixed for 2 weeks with no activity.