2017 © Pedro Peláez
 

package yii2-seo-toolbar

image

understeam/yii2-seo-toolbar

  • Sunday, December 6, 2015
  • by AnatolyRugalev
  • Repository
  • 5 Watchers
  • 5 Stars
  • 135 Installations
  • CSS
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 5 % Grown

The README.md

Yii2 Seo Toolbar

This toolbar allows to easily configure title of page, meta tags or Open Graph tags on your website. It doesn't require any administration panel, it works right in the place (as Yii2 Debug Toolbar)., (*1)

Requirements

This extension requires Redis to be installed and configured as redis application component. The main model class relies on yii\redis\ActiveRecord, (*2)

Installation

$ composer require understeam/yii2-seo-toolbar:0.3 --prefer-dist

Usage

At first, add toolbar to modules configuration and add it into application bootstrap:, (*3)

...
'bootstrap' => ['seoToolbar'],
'modules' => [
    'seoToolbar' => [
        'class' => 'understeam\seotoolbar\Module',
        'permission' => 'seo', // permission to check
        'allowedIPs' => ['*'],
    ],
],
...

It is strongly recommended to use name seoToobar because it is hardcoded (yet)., (*4)

Access control

At this step toolbar should appear if you are logged in and you have permission seo. Basically, module checks permissions with this method:, (*5)

Yii::$app->user->can('seo');

So, if you are not using RBAC and access checks you can make toolbar visible for any logged in user:, (*6)

...
'bootstrap' => ['seoToolbar'],
'modules' => [
    'seoToolbar' => [
        'class' => 'understeam\seotoolbar\Module',
        'permission' => '@', // allow to any logged in user
        'allowedIPs' => ['*'],
    ],
],
...

Also, you may want to show toolbar ALL users and check permissions via IP address:, (*7)

...
'bootstrap' => ['seoToolbar'],
'modules' => [
    'seoToolbar' => [
        'class' => 'understeam\seotoolbar\Module',
        'permission' => null, // allow to any logged in user
        'allowedIPs' => ['127.0.0.1', '192.168.0.1'],
    ],
],
...

Url patterns and model attributes

There is possibility to use a star (*) symbol to transform URL to regular expression:, (*8)

Screenshot, (*9)

Using SeoEntity behavior

Use SeoEntity class as a behavior for your models which attributes you want to use as a parameters in seo toolbar:, (*10)

    public function behaviors()
    {
        return ArrayHelper::merge(parent::behaviors(), [
            'seo' => [
                'class' => 'understeam\seotoolbar\behaviors\SeoEntity',
                'attributes' => [
                    'name',
                    'slug',
                    'description'
                ],
            ],
        ]);
    }

Screenshot, (*11)

The Versions

06/12 2015

dev-master

9999999-dev

  Sources   Download

GPLv3

The Requires

 

by Anatoly Rugalev
by Alexey Deryushev
by Alexey Shabalin

04/12 2015

v0.3

0.3.0.0

  Sources   Download

GPLv3

The Requires

 

by Anatoly Rugalev
by Alexey Deryushev
by Alexey Shabalin

04/12 2015

v0.2

0.2.0.0

  Sources   Download

GPLv3

The Requires

 

by Anatoly Rugalev
by Alexey Deryushev
by Alexey Shabalin

04/12 2015

v0.1

0.1.0.0

  Sources   Download

GPLv3

The Requires

 

by Anatoly Rugalev
by Alexey Deryushev
by Alexey Shabalin