- 🇫🇷France fwust Strasbourg
I tried to reproduce the problem with last 8.x-1.26 version. The meta description is well displayed.
- 🇫🇷France tostinni
@trickfun, can you detail a little bit more how to reproduce this bug, like @fwust I tested on a views page and the meta description is correctly displayed.
Thanks - 🇮🇹Italy trickfun
@tostinni, create a simple view of articles.
When i add metatag field i have only the "Empty formatter" in the formatter select.
The formatter code is:/** * Plugin implementation of the 'metatag_empty_formatter' formatter. * * @FieldFormatter( * id = "metatag_empty_formatter", * module = "metatag", * label = @Translation("Empty formatter"), * field_types = { * "metatag" * } * ) */ class MetatagEmptyFormatter extends FormatterBase { /** * {@inheritdoc} */ public function viewElements(FieldItemListInterface $items, $langcode) { // Does not actually output anything. return []; } }
How can print meta values if the formatter returns empty array?
- 🇮🇳India aditi saraf
i try to reproduce this issue on drupal 11.0.0 . For this i installed metatag , meta tag: view module .And added meta tag field in view . And saved it. I just added some dummy value for meta tag ang in result i can see all the added meta tag. It is working for me . Attaching screenshot below.
- 🇮🇳India aditi saraf
@trickfun just seeing your comment but i already tried it and for me it is working. Thanks
- 🇮🇹Italy trickfun
@aditi saraf
The problem is not the metatag into html page but the value of metatag in view table.
Add metatag field to your view and show me the result table with metatag column.The metatag column is empty.
Thank you - 🇮🇳India aditi saraf
@trickfun i am trying to add metatag as a field in view, but i am not getting any option to add meta tag as a fied. Let me know if i need to install any module for this. I already have meat tag and metatag: view module configured. Attached a file here for same
- 🇮🇹Italy trickfun
@aditi saraf
- go to node article configuration page
- add metatag field to node
- go to your view
- setup you view as table of fields
- add new field to view. search for metatag field name.
- run the view
- the metatag column field is empty. - 🇮🇳India aditi saraf
@trickfun thanks for helping me to reproduce this issue. I tried to apply your patch but still in view metatag field is empty. How everempty formatter is not coming.
- 🇮🇳India aditi saraf
@trickfun after using meta tag i am getting following issue
Drupal\Component\Plugin\Exception\PluginException: Plugin (metatag_empty_formatter) instance class "Drupal\metatag\Plugin\Field\FieldFormatter\MetatagEmptyFormatter" does not exist. in Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass() (line 97 of C:\wamp64\www\dummydr\web\core\lib\Drupal\Component\Plugin\Factory\DefaultFactory.php). - 🇮🇹Italy trickfun
Have you clean the cache?
Look inside metatag\Plugin\Field\FieldFormatter if MetatagEmptyFormatter exists.
Thank you