Yii 1.1: yii-seo

Nice and flexible way to manage your SEO, without rewriting the code
29 followers

yiiSEO

Description

YiiSEO has been completely refactored. It is lot more flexible and now you can make almost any SEO changes without changing your code.

Features :

  • single language and multi-language site support
  • can be used to add author meta, FB meta and many more
  • uses inverse hierarchy to find meta data

Requirements : update your URLManager in /protected/config/main.php this way :

'urlManager'=>array(
            'urlFormat'=>'path',
            'showScriptName'=>false,
),

Installation

  1. Unpack 'yiiseo' folder to '/protected/modules/'
  2. Add folowing code to configuration files (protected/config/main.php)
'modules'=>array(
            ....
            'yiiseo'=>array(
                    'class'=>'application.modules.yiiseo.YiiseoModule',
                    'password'=>'111', // your default password is 111
                 ),
        ),
 
        'components'=>array(
            ....
            'seo'=>array(
            'class' => 'application.modules.yiiseo.components.SeoExt',
            ),
        ),
 
        'import'=>array(
            ....
            'application.modules.yiiseo.models.*',
        ),

3.Run following line of code that suits you into your main layouts head :

  • In case the site has one language:
`Yii::app()->seo->run();`
  • In case when site is multilingual:
`Yii::app()->seo->run(Yii::app()->language);`

4.Run module by typing in the link : http://yoursite.com/yiiseo/

Usage

When you enter this module - you'll see the usual CRUD. For starters - press CreateYiiSEOUrl. In the form below enter your meta data.

URL URL - is the relative link to your project. For example - if you want to write meta for the root(homepage) of your project - just write "/" in the URL.

Another example : You need a SEO meta data for http://example.com/sites/news page. Than in the URL - write down "sites/news" (without shash in the beggining)

If you want to use it for multiple links - for example you have links like this http://example.com/post/7 and you need all posts to have the same meta patern - just use following URL "post/*"

Main meta There are 3 metas that we devided from the rest : Title, meta description, meta keywords. In case of title or description - just type the text as you would usually do. In keywords write down phrases separated by commas.

Params Using the params is a tricky part. To use a param in main meta - just use the "{param}" in place where you want it to be. After that - choose it from the list. The list is auto generated from site models and there relations.

Find us

Find us on GitHub : https://github.com/Idol-IT/yiiSEO

yiiSEO wiki : https://github.com/Idol-IT/yiiSEO/wiki

For more info or advanced functions contact us : http://idol-it.com/

Change Log

19.05.2012

  • change : path to models is now more flexible (thanks to Alexey Naydenko)
  • bug : missing assets folder is now added to archive

17.05.2012

  • feature : added line break for each meta
  • feature : added module logout button
  • feature : no need to create dump files, they are automatically generated
  • change : module password setting is set in 'protected/config/main.php'
  • change : single space added after each comma in keywords
  • feature : no need to create dump files, they are automaticly generated
  • bug : model without db table issue fixed
  • bug : unique session for yiiSEO users, to fix a user authorization conflict
  • bug : tags are now stripped

Total 6 comments

#10871 report it
asifrafeeq at 2012/11/29 03:20am
i m facing the following problem

include(Controller.php) [function.include]: failed to open stream: No such file or directory

#8222 report it
monkeymafia at 2012/05/19 07:09am
problem solved ;)

#8221 Thanks for your collaboration. We've updated the code and uploaded new archive. Also assets folder is now added to archive.

#8221 report it
lehandr at 2012/05/19 04:05am
New issue

#8220 Спасибо за модуль и за быстрый ответ. Несмотря на то, что мой английский коряв, буду писать по-английски, чтобы интересующиеся нерусскоязычные тоже могли учавствовать в развитии модуля.

I'm using non standart directories structure in my projects, so line 303 in the SeoController find nothing:

$file_list = scandir($_SERVER['DOCUMENT_ROOT']."/protected/models");

May be this variant will be more universal:

$file_list = scandir(Yii::getPathOfAlias('application.models'));
#8220 report it
monkeymafia at 2012/05/19 03:17am
will be solved

#8216 Спасибо за замечание.Буду у рабочего компьютера - перезалью архив. Как временное решение - я добавил zip архив с этой папкой в раздел downloads этого проекта.

Thanks for your notice. I will reupload archive as soon as possible. As a temporary matter - I've added a zip archive with assets folder.

#8216 report it
lehandr at 2012/05/18 03:08pm
Error on install

I tried to install this module as describe above and got such error:

Необходимый для отображения asset "Z:\home\SITENAME\app\modules\yiiseo\assets" не существует.

#8192 report it
monkeymafia at 2012/05/16 07:04am
small change

sry guys, had to fix a small bug just now. If you happen to add more than 3 meta's with properties you will run into it. It is now fixed and download archive is updated.

Leave a comment

Please to leave your comment.

Create extension