Put SEO and Twitter card Meta tags in the Head section prior the render of the template I need to put some &lt;meta /&gt; tags in the &lt;head /&gt; section of the html document prior the rendering of the template. I would like to know how can I achieve this? I also need to query an external database in order to get some data from it and populate the meta tags. What I want to accomplish is to pass a link to my website and get Twitter to display a card with the image, description, etc.
What is the best option in order to accomplish this task? a Plugin? a Controller? a Module? Does anybody know any good tutorial or guide in order to do this?
I'm using CraftCMS ver 3.4.9
Thank you in advance for your support.
There's a plugin that allows you to connect to an external database, which will allow you to do a query within the template. Remember to cache the result though as it could slow things down otherwise.
Another option is to sync the external data with Craft using feed me, so you can pull the data locally.