2017 © Pedro Peláez
 

yii2-extension yii2-seotools

Component and module to manage unique seo title, description, keywords and unique text associated with a page

image

jpunanua/yii2-seotools

Component and module to manage unique seo title, description, keywords and unique text associated with a page

  • Thursday, April 9, 2015
  • by jpunanua
  • Repository
  • 3 Watchers
  • 15 Stars
  • 918 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 3 Open issues
  • 1 Versions
  • 4 % Grown

The README.md

Tool to manage particular SEO Metas and text for especial pages

If you need set unique seo title, description associated with a page this is your extension, you can also add a html text using a wysiwis tool to add bold and links and improve your SEO in page with a unique content., (*1)

Set this fields using a module to manage all this functionality., (*2)

Use internally a md5 hash to made a unique id with (Host + Path) to identify pages and yii cache system and tag dependency to improve speed, (*3)

Installation

The preferred way to install this extension is through composer., (*4)

Either run, (*5)

php composer.phar require --prefer-dist jpunanua/yii2-seotools "*"

or add, (*6)

"jpunanua/yii2-seotools": "*"

to the require section of your composer.json file., (*7)

Migration

Run the following command in Terminal for database migration:, (*8)

Linux/Unix:, (*9)

yii migrate/up --migrationPath=@vendor/jpunanua/yii2-seotools/migrations

Windows:, (*10)

yii.bat migrate/up --migrationPath=@vendor/jpunanua/yii2-seotools/migrations

Config

A simple exmple of turning on seotool component., (*11)

'components' => [
        'seotools' => [
            'class' => 'jpunanua\seotools\Component',
        ],
    ],

Turning on the seotools Module:, (*12)

Simple example:, (*13)

    'modules' => [
        'seotools' => [
            'class' => 'jpunanua\seotools\Module',
            'roles' => ['@'], // For setting access levels to the seotools interface.
        ]
    ],

Usage

Once the extension is installed, simply use it in your code by :, (*14)

 // @param bool $setCanonical true, try to create a canonical url and og url, action needs to have params
 // @param bool $checkDb try to get from DB params, true: try to get info from DB if it doesn't find save a new field
 // associated to current host + '/' + path, false: it just set the params give in the call. The db params has priority
 // over the call function params. It does a merge
$setCanonical = false;
$checkDb = true;
Yii::$app->seotools->setMeta(['title' => \Yii::t('title','A good title for this page')], $setCanonical, $checkDb);

You can invalidate the cache save records calling, (*15)

\yii\caching\TagDependency::invalidate(Yii::$app->cache, jpunanua\seotools\Component::CACHE_TAG);

URLs

URLs for the seotools manage module:, (*16)

/seotools/manage
/seotools/manage/create

The Versions

09/04 2015

dev-master

9999999-dev

Component and module to manage unique seo title, description, keywords and unique text associated with a page

  Sources   Download

MIT

The Requires

 

by Javier Pérez Unanua

extension yii2 management title seo optimize description metas