Jump to content

how to define an opengraph image for the root URL, without overriding all other pages' OG


Recommended Posts

I found that this line was not present in head.tpl , but if I were to put it in, wouldn't that over-write the OG images on each other page? Where can I properly define the og:image for ONLY the root URL?

<meta property=”og:image” content=”{$img_ps_dir}logo.jpg”> 

I tried setting a category cover image for the 'home' category, but that didn't work, and I do purposely have the display of the 'home' category set to off.

Link to comment
Share on other sites

so the $img_ps_dir might predate 1.7.8

I instead tried <meta property="og:image" content="/img/metacardlogo.jpg" /> in the theme/classic/templates/_partials/head.tpl inserted after line  65.

and that did in fact overwrite every other og:image throughout the site, as i suspected it would, so I assume that I would need to wrap the meta property in an {if !isset} to detect if ONLY it is the root URL, but I am at a loss of how to properly do that.

Edited by Paul Buisson (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...