grptx/yii2-seo-tags

Yii2 Component to render some seo tags

Installs: 115

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii2-extension

v1.1.0 2018-02-01 13:49 UTC

This package is auto-updated.

Last update: 2024-12-18 23:42:19 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

Installation

Preferred way to install is through Composer:

php composer.phar require grptx/yii2-seo-tags:~1.0

Or, you may add

"grptx/yii2-seo-tags": "~1.0"

to the require section of your composer.json file and execute php composer.phar update.

Configuration

...
'components' => [
    'seotag' => [
        'class' => 'grptx\SEO\SeoTag',
        // you can add some global tag here (optional)
        'metas'=>[
            'twitter'=>[
                'twitter:creator'=>'@grptx'
                // ...
            ]
            // ...
        ]
    ]
...
]

Usage

/** @var \grptx\SEO\SeoTag $seotag */
$seotag = Yii::$app->seotag;
$seotag->setAndRender([
   'facebook' => [
           'og:title' => '<open graph title>'
        // ...
   ],
   'twitter' => [
        // ...
   ],
   'site' => [
        // ...
   ]   
]);

Available Tags

Facebook Open Graph

  • og:locale
  • og:type
  • og:title
  • og:description
  • og:url
  • og:site_name
  • og:updated_time
  • og:image
  • og:image:secure_url
  • og:image:width
  • og:image:height
  • og:image:alt
  • fb:app_id

Twitter Card

  • twitter:card
  • twitter:creator
  • twitter:site
  • twitter:title
  • twitter:description
  • twitter:image
  • twitter:image:alt
  • twitter:player
  • twitter:player:stream
  • twitter:player:stream:content_type
  • twitter:player:width
  • twitter:player:height
  • twitter:app:id:iphone
  • twitter:app:id:ipad
  • twitter:app:id:googleplay
  • twitter:app:url:iphone
  • twitter:app:url:ipad
  • twitter:app:country
  • twitter:app:url:googleplay

Site

  • description