Add differents meta tag every joomla article

I'd like to add facebook open graph tags in my joomla website. I edited index.php and add manually:

<head>
    <title>The Rock (1996)</title>
    <meta property="og:title" content="The Rock"/>
    <meta property="og:type" content="movie"/>
    <meta property="og:url" content="http://www.imdb.com/title/tt0117500/"/>
    <meta property="og:image" content="http://ia.media-imdb.com/rock.jpg"/>
    <meta property="og:site_name" content="IMDb"/>
    <meta property="fb:admins" content="USER_ID"/>
    <meta property="og:description"
          content="A group of U.S. Marines, under command of
                   a renegade general, take over Alcatraz and
                   threaten San Francisco Bay with biological
                   weapons."/>

  </head>

In this way meta tags is applied to all my website pages.

How can I add different meta tags for every joomla article?

Answers


You can use one of the Open Graph Plugins for Joomla standard content if you like. Maybe like http://itprism.com/free-joomla-extensions/social-marketing-seo/open-graph-meta


A basic method of stitching the meta tags is explained in this article.

$opengraph    = '<meta property="og:title" content="'.$game->title.'"/>' ."\n";
$opengraph .= '<meta property="og:type" content="'."BLOG_replacewithyourtype".'"/>' ."\n";
$opengraph .= '<meta property="og:url"  content="'. $myabsoluteurl.'"/>' ."\n";
$opengraph .= '<meta property="og:image" content="'."http://YOURSITE.com/.../images/".$blog->imagename.'"/>' ."\n";
$opengraph .= '<meta property="og:site_name" content="'."YOUR SITE TITLE".'"/>' ."\n";
$opengraph .= '<meta property="fb:admins" content="'."YOUR FACE BOOK DEVELOPER CODE".'"/>' ."\n";
//add the tags to the head of the page;[/
$document->addCustomTag($opengraph);

You can add specific meta to each article via the navigation menu in the administratio0n back end. Each parent and child has its own meta fields located via the dropdowns on the right hand side when viewing a particular navigation item.


Need Your Help

Apache fails to start in MAMP PRO version 4.0

apache mamp mamp-pro

I've just installed the latest version for MAMP PRO - Version 4.0.

parseJSON not catching form POST to python

javascript jquery python html json

I have javascript HTML page which has an action POST to a python file. The python code is supposed to send back a JSON to the HTML. I just do not know how to catch the JSON and parse it. I think I ...