I have an EE website (www.regulatoryindex.com) that produces news articles. Some of these I like to share on LinkedIn. BUT unfortunately when I do LinkedIn doesn’t grab the image, the name of the news article or the description.
This particular new article (https://www.regulatoryindex.com/news/article/covid19-are-we-being-experimented-on) I tried on LinkedIn Post Inspector and it asked me to Add an og:description tag to the page to have control over the content’s description on LinkedIn.
In relation to the Image it said to add <meta name=”image” property=”og:image” content=”[Image URL here]”> to the page’s head section and similar for the Description and Author.
Now here’s the problem (for me), I have super user access to the site (the previous developers no longer have their EE expert and now want to charge me £A Lot per hour) but I think I need some help.
I’m comfortable editing the relevant templates to add the correct OG meta tags code and I am aware of the correct template that contains the <head> information for each of my pages BUT, I am not sure how to enter the details in the template to make sure it pulls out the relevant details from the individual News pages (individual Entry) each time.
The META info I intend to add to the <head> section is shown below, but the bits in [square brackets] is where I need help PLEASE!!
<meta content=”[title of news item page]” property=”og:title” /> <meta content=”[background image of the specific page]” property=”og:image” /> <meta content=”[abbreviated article desecription]” property=”og:description” /> <meta content=”[the relevant URL for each page]” property=”og:url” />
I’ve attached a couple of images that may help, including the entry for the page in question and the code for the relevant template
Many thanks in advance
It’d be a lot easier if you use “template layouts” which allow you to output values more easily.
However it’s still possible using your existing includes/header template - you seem to be calling an exp:channel:entries tag for, I presume, single entry pages, so you’d add your meta data fields in there.
First you need to add some custom fields for your meta data to whatever channels need them.
Second you need to call those fields in your header template, here’s a simplified example:
{exp:channel:entries...}
<title>{title} | Regulatory index</title>
<meta name="description" content="{your_meta_field}">
<meta name="og:description" content="{your_meta_field}">
{/exp:channel:entries}
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.