1

would like to as if is there such a thing that I can assign/update the meta tag data for each page? Noted that I have read meta tag must be put in the <head> tag so how should I design my code? This is what i wanted to achieve:

page1.php
<meta name="description" content="Page 1">
<meta name="author" content="owner 1">

page 2.php
<meta name="description" content="Page 2">
<meta name="author" content="owner 2">

And also how should I point to the relevant images when the facebook share link query? Like this:

FB Share

Hopefully someone could give me some guides. Thank you

DavidT
  • 2,341
  • 22
  • 30
Kenny Yap
  • 1,317
  • 5
  • 17
  • 39
  • What framework (MVC or CMS), or templating system are you using? – DavidT Sep 25 '14 at 11:42
  • @DavidT I am using Yii framework – Kenny Yap Sep 25 '14 at 11:44
  • I am unfamiliar with that particular frameworks syntax/file structure, but have added the tag for you to bring in some Yii developers. Though I think you need `og:` metatags for use with Facebook. – DavidT Sep 25 '14 at 11:58

1 Answers1

1

In your Action add this:

Yii::app()->clientScript->registerMetaTag('Page 1', 'description');

Before redering your page. For more information see this article

About facebook meta tags, you can look this article.

The Facebook uses The Open Graph meta tags, so see the specs to more information about it.

Community
  • 1
  • 1
Francisco Cabral
  • 856
  • 11
  • 21
  • Would like to check with you for like `` and `` the image does it only accept 1 image link or i can add more to it? – Kenny Yap Sep 26 '14 at 11:11
  • @KennyYap I don't really know how people do it, because the [specs](https://developers.facebook.com/docs/opengraph/using-objects) says: `Each URL can only be a single object`. If you have a website to test, you can validate [here](https://developers.facebook.com/tools/debug/og/object) – Francisco Cabral Sep 26 '14 at 12:58
  • 1
    @KennyYap See this [article](http://ogp.me/#array), will help you with the `og: meta tags`. This article have the specs from Open Graph(aka og), and there are many informations that will help you. – Francisco Cabral Sep 26 '14 at 13:13