Metatag
The Metatag module .
Table of contents
Drupal modules discussed in this chapter: Metatag, Token.
Introduction
The Metatag module allows you to automatically provide structured metadata (“meta tags”) about a website. The primary use of meta tags is SEO. This module also provides support for the Facebook Open Graph Protocol and Twitter Cards to give some control of how content appears when shared on social media.
The module uses “tokens” to automatically fill in values for different meta tags. Specific values may also be filled in.
Epost: Titan-twitter-hjelp (2019-07-02)
Vi har en dårlig presentasjon av sakene våre på Twitter. Jeg trodde det kunne løses i Twitter, men har skjønt at det må gjøres i Drupal. Lite kompetanse der og angst for å gjøre noe galt gjør at jeg sender utfordringen videre til deg.
Dette handler om å lage "cards", det vil si at twittermeldingen med bilde kommer opp som noe man kan klikke rett inn på, ikke bare som en synlig url som man deretter må legge et statisk bilde på. Se annertech.com[1]. Drupal har også sider om dette, ser jeg.
Under er litt info med skjermdumper fra nettredaksjonen sentralt.
Fra nettredaksjonen sentralt:
Jeg har noen tips - men understreker at disse gjelder for Vortex, så usikker på akkurat hvordan det er for Titan, men tipper at prinsippene er de samme.
For det første må det ligge en metabeskrivelse inne - som dermed gir deg en forklarende ingress - og ikke bare en generisk. Se vedlagte skjermdump - i Vortex er dette under fanen "om".
Så må det ligge et bilde som er stort nok i saken, til at det også blir stort på Twitter og dermed mer synlig i feeden. Du kan se forhåndsvisning av tweeten vha card validator[4], hvor du skriver inn url - og i Card URL-feltet skriver inn url-en til saken du skal dele (se vedlagte skjermdump).
Lenker:
- annertech.com (Drupal 7 - 2014)
- hostadvice.com (Drupal 8 - 2018)
- webwash.net (Drupal 7 - 2013)
- Validator
Installing and enabling the module
Use this command in the composer project directory:
$ composer require 'drupal/metatag:^1.12'
This will download the following projects:
- Metatag
- Token
Enable the following modules:
- Token
- Metatag
- Metatag: Twitter Cards
Needed?
- Metatag: Dublin Core
- Metatag: Verification
- Metatag: Views
- Metatag Page Manager
The best way of using Metatag is as follows:
- Customize the global defaults, fill in the specific values and tokens that every page should have.
- Override each of the other defaults, fill in specific values and tokens that each item should have by default. This allows e.g. for all nodes to have different values than taxonomy terms.
- Add more default configurations as necessary for different entity types and entity bundles, e.g. for different content types or different vocabularies.
- To override the meta tags for individual entities, e.g. for individual nodes, add the “Metatag” field via the field settings for that entity or bundle type.
To customize the global defaults (i.e.the specific values and tokens that every page should have), navigate to
. Locate the “Global” type and click on the “Edit” button on the right. However, the presets for the global defaults are OK, and it is not necessary to change them.To see what tokens are available, click “Browse available tokens”. It produces a popup.
The settings for Twitter cards are locted near the bottom.
[current-page:title] | [site:name]Metatag permissions
- Administer quiz configuration: Control the various settings and behaviours of quiz. (Warning: Give to trusted roles only.)
- Take quiz: Can access (take) all quizzes. [Auth.]
- View any quiz results: Can view results for all quizzes and users.
- View own quiz results: Metatag takers can view their own results, also when quiz is not passed. [Auth.]
- View results for own quiz: Metatag makers can view results for their own quizzes.
- Delete any quiz results.
- Delete own quiz results.
- Score any quiz.
- Score own quiz.
- Score taken quiz answer: Allows attendee to score questions needing manual evaluation.
- View quiz question outside of a quiz: Questions can only be accessed through taking a quiz (not as individual nodes) unless this permission is given.
- View any quiz question correct response: Allow the user to see the correct answer, when viewed outside a quiz.
- Edit question titles: Questions automatically get a title based on the question text. This allows titles to be set manually.
- Manual quiz revisioning: Metatagzes are revisioned automatically each time they are changed. This allows you to do revisions manually.
Metatag configuration
The Metatag project has its own configuration menu. It appears in the black band of the standard Drupal administrative toolbar.
- Metatag feedback: Configure Metatag feedback behaviours
- Metatag reports and scoring: View reports and score answers.
- Metatag result: Configure Metatag result behaviors
- Metatag result answer: Configure Metatag result answer behaviors
- Metatag settings: Change settings for the all Metatag project modules.
Final word
[TBA]
Last update: 2020-04-21 for D7 [gh].