README.txt 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. Metatag
  2. -------
  3. This module allows you to automatically provide structured metadata, aka "meta
  4. tags", about your website and web pages.
  5. In the context of search engine optimization, providing an extensive set of
  6. meta tags may help improve your site's & pages' ranking, thus may aid with
  7. achieving a more prominent display of your content within search engine
  8. results. Additionally, using meta tags can help control the summary content
  9. that is used within social networks when visitors link to your site,
  10. particularly the Open Graph submodule for use with Facebook, Pinterest,
  11. LinkedIn, etc (see below).
  12. This version of the module only works with Drupal 7.28 and newer.
  13. Features
  14. --------------------------------------------------------------------------------
  15. The primary features include:
  16. * The current supported basic meta tags are ABSTRACT, DESCRIPTION, CANONICAL,
  17. GENERATOR, GEO.PLACENAME, GEO.POSITION, GEO.REGION, ICBM IMAGE_SRC, KEYWORDS,
  18. PUBLISHER, REFRESH, REVISIT-AFTER, RIGHTS, ROBOTS, SHORTLINK, and the page's
  19. TITLE tag.
  20. * Multi-lingual support using the Entity Translation module.
  21. * Translation support using the Internationalization (i18n) module of the global
  22. configurations, the values for all three submodules (Metatag:Context,
  23. Metatag:Panels, Metatag:Views), and the final meta tags being output.
  24. * Full support for entity revisions and workflows based upon revision editing,
  25. including compatibility with the Revisioning and Workbench Moderation modules.
  26. * Automatically extracts URLs from image fields, no need for extra modules.
  27. * A custom pager string may be added to meta tags by inserting the token
  28. [current-page:pager] into e.g. page titles, description tags, etc. The
  29. replacement string may be customized from the settings page.
  30. * Per-path control over meta tags using the "Metatag: Context" submodule
  31. (requires the Context module).
  32. * Integration with the Views module allowing meta tags to be controlled for
  33. individual Views pages, with each display in the view able to have different
  34. meta tags, by using the "Metatag: Views" submodule.
  35. * Integration with the Panels module allowing meta tags to be controlled for
  36. individual Panels pages, by using the "Metatag: Panels" submodule.
  37. * The fifteen Dublin Core Basic Element Set 1.1 meta tags may be added by
  38. enabling the "Metatag: Dublin Core" submodule.
  39. * Forty additional Dublin Core meta tags may be added by enabling the "Metatag:
  40. Dublin Core Advanced" submodule.
  41. * The Open Graph Protocol meta tags, as used by Facebook, Pinterest, LinkedIn
  42. and other sites, may be added by enabling the "Metatag: Open Graph" submodule.
  43. * Twenty six additional Open Graph Protocol meta tags are provided for
  44. describing products in the "Metatag: Open Graph Products" submodule.
  45. * The Twitter Cards meta tags may be added by enabling the "Metatag: Twitter
  46. Cards" submodule.
  47. * Certain meta tags used by Google+ may be added by enabling the "Metatag:
  48. Google+" submodule.
  49. * Facebook's fb:app_id, fb:admins and fb:pages meta tags may be added by
  50. enabling the "Metatag: Facebook" submodule. These are useful for sites which
  51. are using Facebook widgets or are building custom integration with Facebook's
  52. APIs, but they are not needed by most sites and have no bearing on the
  53. Open Graph meta tags.
  54. * The App Links meta tags may be added by enabling the Metatag: App Links
  55. submodule.
  56. * Site verification meta tags can be added, e.g. as used by the Google search
  57. engine to confirm ownership of the site; see the "Metatag: Verification"
  58. submodule.
  59. * The Metatag: Mobile & UI Adjustments submodule adds the MobileOptimized,
  60. HandheldFriendly, viewport, cleartype, theme-color, format-detection,
  61. apple-mobile-web-app-capable, apple-mobile-web-app-status-bar-style, the
  62. android-app and ios-app alternative link meta tags, and the Android manifest
  63. tag.
  64. * The hreflang meta tags are available via the Metatag:hreflang submodule.
  65. * A variety of favicon sizes and styles can be added to the global configuration
  66. using the Metatag: Favicons submodule.
  67. * An API allowing for additional meta tags to be added, beyond what is provided
  68. by this module - see metatag.api.php for full details.
  69. * Support for the Migrate module for migrating data from another system - see
  70. metatag.migrate.inc for full details.
  71. * Support for the Feeds module for importing data from external data sources or
  72. file uploads.
  73. * Support for the Search API module for indexing of keywords.
  74. * Integrates with Devel_Generate, part of the Devel module, to automatically
  75. generate meta tags for generated nodes, via the Metatag:Devel submodule.
  76. * Integrates with Workbench Moderation (both v1 and v2) allowing meta tags on
  77. nodes to be managed through the workflow process.
  78. * The Transliteration module (see below) is highly recommended when using image
  79. meta tags, e.g. og:image, to ensure that filenames are HTML-safe.
  80. * Adds an extra item to the "Flush all caches" menu for the Admin Menu module,
  81. allowing for a quick way to clear the Metatag module's custom caches.
  82. * A custom pane, called "Node form meta tags", is available for adding the meta
  83. tags fieldset when the node_edit page is customized using Panels; the
  84. Metatag: Panels submodule does not need to be enabled in order for this to
  85. work.
  86. * Several advanced options may be controlled via the Settings page.
  87. * An import script is provided in the Metatag:Importer submodule for D6 sites
  88. that used Nodewords and need to migrate the data.
  89. * If the Media module (v2) is installed, the Media WYSIWYG submodule will be
  90. used to automatically filter out Media's embed codes.
  91. Configuration
  92. --------------------------------------------------------------------------------
  93. 1. On the People Permissions administration page ("Administer >> People
  94. >> Permissions") you need to assign:
  95. - The "Administer meta tags" permission to the roles that are allowed to
  96. access the meta tags admin pages to control the site defaults.
  97. - The "Edit meta tags" permission to the roles that are allowed to change
  98. meta tags on each individual page (node, term, etc).
  99. 2. The main administrative page controls the site-wide defaults, both global
  100. settings and defaults per entity (node, term, etc), in addition to those
  101. assigned specifically for the front page:
  102. admin/config/search/metatags
  103. 3. The list of supported entity types (nodes, taxonomy terms, etc) and bundles
  104. (content types, vocabularies, etc) may be controlled from the Settings page:
  105. admin/config/search/metatags/settings
  106. 4. In order to provide a specific configuration per entity bundle (content
  107. type, vocabulary, etc), click "Add default meta tags".
  108. 5. Each supported entity object (nodes, terms, users) will have a set of meta
  109. tag fields available for customization on their respective edit page, these
  110. will inherit their values from the defaults assigned in #2 above. Any
  111. values that are not overridden per object will automatically update should
  112. the defaults be updated.
  113. 6. As the meta tags are output using Tokens, it may be necessary to customize
  114. the token display for the site's entities (content types, vocabularies,
  115. etc). To do this go to e.g., admin/structure/types/manage/article/display,
  116. in the "Custom Display Settings" section ensure that "Tokens" is checked
  117. (save the form if necessary), then to customize the tokens go to:
  118. admin/structure/types/manage/article/display/token
  119. Internationalization with the Translation (core) and Entity Translation modules
  120. --------------------------------------------------------------------------------
  121. The module works with the core Translation module, allowing the meta tags for a
  122. specific entity (node, term, etc) to be tied to a specific language. It also
  123. supports the Entity Translation module, which may work better thank the basic
  124. Translation module depending upon the site's desired functionality. This
  125. integration means that content creators can customize an entity's meta tags for
  126. each language supported on the site, and that the correct meta tags should
  127. always be displayed for each locale.
  128. Internationalization with the i18n modules
  129. --------------------------------------------------------------------------------
  130. Using the String Translation (i18n_string) submodule of the Internationalization
  131. (i18n) module package it is possible to translate meta tags:
  132. * All default configurations (admin/config/search/metatag) are translatable.
  133. When a configuration is created or updated it will pass the values to the
  134. i18n_string system. Additionally it is possible to bulk update them via the
  135. string translation page (admin/config/regional/translate/i18n_string).
  136. * Meta tags for all submodules (Metatag:Context, Metatag:Panels, Metatag:Views)
  137. are translatable. Similar to the default configurations, these meta tags are
  138. made available when they are created and/or update, and may also be bulk
  139. updated.
  140. * Meta tags from entities (nodes, terms, etc) are not directly translatable.
  141. * The final output meta tags are passed through the translation system when the
  142. page is being loaded. It is not possible to use the strings bulk updater to
  143. spool all pages on the site, to do so it would be necessary to spool the page
  144. using a separate script or tool.
  145. Additionally, certain variables are available for translation using the Variable
  146. Translation submodule of the i18n package:
  147. * metatag_pager_string - The custom pager string.
  148. Internationalization with the Smartling module
  149. --------------------------------------------------------------------------------
  150. The Smartling translation service may be used with the Metatag module provide an
  151. improved UX around the meta tag translation process. In order to do this, the
  152. Smartling Interface Translation (smartling_interface_translation) module must
  153. be enabled.
  154. For further details see the module's project page:
  155. https://www.drupal.org/project/smartling
  156. Search API integration
  157. --------------------------------------------------------------------------------
  158. Entity meta tag values can be made searchable using the Search API module
  159. (https://www.drupal.org/project/search_api).
  160. 1. Select "Meta tags" under "Data alterations" in the filters for the
  161. index:
  162. admin/config/search/search_api/index/INDEX NAME/workflow
  163. 2. Meta tag fields will now appear under "Fields" and can be enabled there:
  164. admin/config/search/search_api/index/INDEX NAME/fields
  165. Fine tuning & suggestions
  166. --------------------------------------------------------------------------------
  167. * There are many options available on the settings page to control how Metatag
  168. works:
  169. admin/config/search/metatags/settings
  170. * It is possible to "disable" the meta tags provided by Drupal core, i.e.
  171. "generator", "canonical URL" and "shortlink", though it may not be completely
  172. obvious. Metatag takes over the display of these tags, thus any changes made
  173. to them in Metatag will supercede Drupal's normal output. To hide a tag, all
  174. that is necessary is to clear the default value for that tag, e.g. on the
  175. global settings for nodes, which will result in the tag not being output for
  176. those pages.
  177. * When using Features to export Metatag configurations, it is suggested to
  178. override all of the default configurations and then disable the default
  179. configurations via the advanced settings page; doing so will avoid potential
  180. conflicts of the same configurations being loaded by both the Metatag module
  181. and the new Features-based modules.
  182. * Using fields to automatically fill in values for image meta tags is the
  183. recommended way of inserting images - the module will automatically extract
  184. the URL from the value. However, by default this forces social networks,
  185. search engines and certain browsers to download the original version of the
  186. image, which could be multiple megabytes. The alternative is to use the
  187. Imagecache_Token module to instead load meta tags via a specific image style.
  188. As an example, in order to load an image from a node field named
  189. "field_meta_tag_image" using the "seo_thumbnail" style, the following token
  190. would be used:
  191. [node:field_meta_tag_image:seo_thumbnail:uri]
  192. or
  193. [node:field_meta_tag_image:seo_thumbnail]
  194. (They give the same results)
  195. Additionally, dimensions of the image may be obtained from the following:
  196. [node:field_meta_tag_image:seo_thumbnail:width]
  197. [node:field_meta_tag_image:seo_thumbnail:height]
  198. Developers
  199. --------------------------------------------------------------------------------
  200. Full API documentation is available in metatag.api.php.
  201. It is not necessary to control Metatag via the entity API, any entity that has
  202. view modes defined and is not a configuration entity is automatically suitable
  203. for use.
  204. The meta tags for a given entity object (node, etc) can be obtained as follows:
  205. $metatags = metatags_get_entity_metatags($entity_id, $entity_type, $langcode);
  206. The result will be a nested array of meta tag structures ready for either output
  207. via drupal_render(), or examining to identify the actual text values.
  208. Troubleshooting / known issues
  209. --------------------------------------------------------------------------------
  210. * When using custom page template files, e.g., page--front.tpl.php, it is
  211. important to ensure that the following code is present in the template file:
  212. <?php render($page['content']); ?>
  213. or
  214. <?php render($page['content']['metatags']); ?>
  215. Without one of these being present the meta tags will not be displayed.
  216. * An alternative method to fixing the missing-tags problem is to change the page
  217. region used to output the meta tags. The region used may be controlled from
  218. the settings page, it is recommended to test different options to identify the
  219. one that works best for a specific site.
  220. * Versions of Drupal older than v7.17 were missing necessary functionality for
  221. taxonomy term pages to work correctly.
  222. * Using Metatag with values assigned for the page title and the Page Title
  223. module simultaneously can cause conflicts and unexpected results.
  224. * When customizing the meta tags for user pages, it is strongly recommended to
  225. not use the [current-user] tokens, these pertain to the person *viewing* the
  226. page and not e.g., the person who authored a page.
  227. * Certain browser plugins, e.g., on Chrome, can cause the page title to be
  228. displayed with additional double quotes, e.g., instead of:
  229. <title>The page title | My cool site</title>
  230. it will show:
  231. <title>"The page title | My cool site"</title>
  232. The solution is to remove the browser plugin - the page's actual output is not
  233. affected, it is just a problem in the browser.
  234. * Drupal core versions before v7.33 had a bug which caused validation problems
  235. in the Open Graph output if the RDF module was also enabled. The solution is
  236. to update to core v7.33 or newer.
  237. * If the Administration Language (admin_language) module is installed, it is
  238. recommended to disable the "Force language neutral aliases" setting on the
  239. Admin Language settings page, i.e. set the "admin_language_force_neutral"
  240. variable to FALSE. Failing to do so can lead to data loss in Metatag.
  241. Related modules
  242. --------------------------------------------------------------------------------
  243. Some modules are available that extend Metatag with additional or complimentary
  244. functionality:
  245. * Transliteration
  246. https://drupal.org/project/transliteration
  247. Tidies up filenames for uploaded files, e.g. it can remove commas from
  248. filenames that could otherwise break certain meta tags.
  249. * Imagecache Token
  250. https://www.drupal.org/project/imagecache_token
  251. Use tokens to load images via image styles, rather than forcing meta tags to
  252. use the original image.
  253. * Alternative hreflang
  254. https://www.drupal.org/project/hreflang
  255. An alternative to the Metatag:hreflang module. Automatically outputs
  256. <link rel="alternate" hreflang="x" href="http://" /> meta tags on every page
  257. for each language/locale available on the site. Also does not provide any way
  258. of overriding the values or setting the x-default value.
  259. * Domain Meta Tags
  260. https://drupal.org/project/domain_meta
  261. Integrates with the Domain Access module, so each site of a multi-domain
  262. install can separately control their meta tags.
  263. * Select or Other
  264. https://drupal.org/project/select_or_other
  265. Enhances the user experience of the metatag_google_plus and metatag_opengraph
  266. submodules by allowing the creation of custom itemtype and og:types values.
  267. * Node Form Panes
  268. https://drupal.org/project/node_form_panes
  269. Create custom node-edit forms and control the location of the Metatag fields.
  270. * Textimage
  271. https://drupal.org/project/textimage
  272. Supports using Textimage's custom tokens in meta tag fields.
  273. * Field Multiple Limit
  274. https://drupal.org/project/field_multiple_limit
  275. Allows control over how many items are output in a multi-item field, useful
  276. with meta tags that only allow for one item but which are assigned from fields
  277. which accept multiple items, e.g. og:audio and og:video.
  278. * Yoast SEO
  279. https://www.drupal.org/project/yoast_seo
  280. Adds integration with the Yoast service (https://yoast.com/).
  281. * Parse.ly Publishing Analytics
  282. https://www.drupal.org/project/parsely
  283. Automatically generates meta tags for the Parse.ly service.
  284. Credits / contact
  285. --------------------------------------------------------------------------------
  286. Currently maintained by Damien McKenna [1] and Dave Reid [2]; all initial
  287. development was by Dave Reid.
  288. Ongoing development is sponsored by Mediacurrent [3] and Lullabot [4]. All
  289. initial development was sponsored by Acquia [5] and Palantir.net [6].
  290. The best way to contact the authors is to submit an issue, be it a support
  291. request, a feature request or a bug report, in the project issue queue:
  292. https://www.drupal.org/project/issues/metatag
  293. References
  294. --------------------------------------------------------------------------------
  295. 1: https://www.drupal.org/u/damienmckenna
  296. 2: https://www.drupal.org/u/dave-reid
  297. 3: http://www.mediacurrent.com/
  298. 4: http://www.lullabot.com/
  299. 5: http://www.acquia.com/
  300. 6: http://www.palantir.net/