Adding custom meta tags to the doc head?

3,961 views
Skip to first unread message

Matt Thomson

unread,
Oct 20, 2010, 8:47:12 PM10/20/10
to Joomla! General Development
Hi All,

I'm trying to add this tag to the head of the document ( using Joomla
1.5):

<meta property="og:image" content="thumbnail_image_path" />

This is for the facebook share button:

http://developers.facebook.com/docs/share

The setMetaData function in JDocument assumes the meta tag should be:
<meta name="og:image"
rather than;
<meta property="og:image"

Facebook does not read the <meta name= tag.

Does anyone know a trick to get around this.

I need to do things the official way, as the code is going into a 3rd
party extension (I can't just hack my template etc).

Thanks,

Matt.

Niels Braczek

unread,
Oct 20, 2010, 11:18:17 PM10/20/10
to joomla-de...@googlegroups.com
Matt Thomson schrieb:

> Hi All,
>
> I'm trying to add this tag to the head of the document ( using Joomla
> 1.5):
> <meta property="og:image" content="thumbnail_image_path" />

JDocumentHTML::addCustomTag() should do the job.

Regards,
Niels

Phil Snell

unread,
Oct 21, 2010, 12:07:54 AM10/21/10
to joomla-de...@googlegroups.com
you can try JDocument's addCustomTag()

http://docs.joomla.org/JDocumentHTML/addCustomTag


--
Phil Snell
Web Designer and Developer
Joomla! CMS Solutions Specialist
Snellcode LLC
Skype: philippe.snell
Mobile: 513-709-4014
www.snellcode.com

Matt Thomson

unread,
Oct 21, 2010, 7:38:48 PM10/21/10
to Joomla! General Development
Thanks, exactly what I needed.
Reply all
Reply to author
Forward
0 new messages