Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Is it possible to display the content of the meta description field in a View?
When I try this the field stays empty in the view.
Maybe there is a workaround or something with the rewrite rules?
Comments
Comment #1
valthebaldWith views pages, you should use path-based meta tags (they are on by default).
If you are logged as admin, you should see 'Edit meta tags' link when you view the page (important: not in view edit, but in view 'view')
Comment #2
rgraaf CreditAttribution: rgraaf commentedThank you for your answer, only I meant something else.
I have made a view so I can see the meta descriptions on my pages in a table so I can see if the meta description is filled in.
It's a table with the different meta descriptions of a content type, only the fields are empty.
Comment #3
rgraaf CreditAttribution: rgraaf commentedComment #4
valthebaldI see 2 possible solutions:
a) add regular field to display it anywhere, and use tokens to copy this field's value to meta fields. Does not require any fix.
b) add new formatter to the metatags_quick field output. Current default formatter adds meta element to the head, new formatter can output field's value as HTML. Requires patching.
Comment #5
pawciow88 CreditAttribution: pawciow88 commentedhey guys, got same issue here.
I hope i understand how it works correctly - in orther to description be change on view page you have to load the meta field into a view. Then:
(solution a)) rewriting meta field with any replacement tokens or some raw value doesn't work - it stays the same. Is there othere way to use token to make it work?