daxslab/yii2-taggedview Extension to help setup the standard HTML meta tags besides the ones defined by Opengraph and Twitter to contribute to website SEO

seohtmlfacebooktwittermetatags

TaggedView

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

Extension to help setup the standard HTML meta tags besides the ones defined by Opengraph and TwitterCard to contribute to website SEO

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist daxslab/yii2-taggedview "*"

or add

"daxslab/yii2-taggedview": "*"

to the require section of your composer.json file.

Configuration

Configure the View component into the main configuration file of your application:

'components' => [
    //...
    'view' => [
        'class' => 'daxslab\taggedview\View',
        //configure some default values that will be shared by all the pages of the website
        //if they are not overwritten by the page itself
        'image' => 'http://domain.com/images/default-image.jpg',
    ],
    //...
]

Defaults

The component will try to set some properties by default:

$this->site_name = Yii::$app->name;
$this->url = Yii::$app->request->baseUrl;
$this->locale = Yii::$app->language;

You can overwrite the content of this tags in every page or in the component configuration.

Usage

Once the extension is configured, simply use it in your views by:

<?php 
    $this->title = 'page title';
    $this->description = 'page description';
    $this->keywords = ['keywords', 'for', 'this', 'page'];
    $this->image = 'http://domain.com/images/page-image.jpg'; 
?>

Proudly made by Daxslab.

Changelog

Yii2 TaggedView Change Log

1.0.1 February 20, 2018

  • Fix #1: Do not send metatags in Ajax response.
  • Enh: Added this CHANGELOG.md
  • Enh: Source code comments.
  • Enh: Improvements of instructions in the README.md

1.0.0 December 24, 2017

  • Initial release.

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



1.0.3 is the latest of 4 releases



MIT license
Stats
11 github stars & 0 github forks
3 downloads in the last day
99 downloads in the last 30 days
2649 total downloads