dev-master
9999999-devSeo plugin for CakePHP 3
MIT
The Requires
The Development Requires
dev-develop
dev-developSeo plugin for CakePHP 3
MIT
The Requires
The Development Requires
Seo plugin for CakePHP 3
A SEO plugin for cakePHP 3 to manage seo tags with ease. It comes with a Behavior, a Component, a View Cell and the default admin crud actions for each tables., (*2)
Note: This plugin has been inspired by CakePHP-Seo-Plugin, (*3)
You can install this plugin into your CakePHP application using composer., (*4)
The recommended way to install composer packages is:, (*5)
composer require orgasmicnightmare/cakephp-seo
Then update your database to create the new tables, (*6)
bin/cake migrations migrate -p Seo
You can now access to the admin sections : - yoursite/admin/seo/seo-uris - yoursite/admin/seo/seo-titles - yoursite/admin/seo/seo-meta-tags - yoursite/admin/seo/seo-canonicals, (*7)
The SeoBehavior allows you to automatize the creation of seo fields when you add a new entry., (*8)
Configure the behavior, see below default configuration, and each time you will add an entry, all configured tags will be generated. It's a real time saverā¦, (*9)
Later you can access to the data throw the admin sections or via the Seo cell box if in you add it in your model view., (*10)
default configuration is :, (*11)
$_defaultConfig = [ 'urls' => [ [ 'url' => [ 'prefix' => false, 'action' => 'view', '_' => [ 'slug' => 'slug' ] ], 'title' => 'Seo default title', 'canonical' => true, 'meta_tags' => [ 'og:type' => [ 'content' => 'website', 'is_property' => true ], 'og:description' => [ 'content' => '{{content}}', 'is_property' => true ], 'og:locale' => [ 'callback' => 'getLocale', 'is_property' => true ], 'twitter:description' => [ 'content' => '{{content}}', 'is_property' => true ], ] ] ] ];
{{name}}
, will just use the field 'name' to fill the title tag.Hello {{name}}
the text in the double accolade is a field of the entity.The SeoComponent prepare and send informations to the view based on the URI.
To use it, just add it in your AppController.php
or any child controllers., (*12)
default configuration is :, (*13)
$_defaultConfig = [ 'excludePrefix' => ['admin'], 'defaults' => [ 'title' => 'Default Title', 'prefix' => null, 'suffix' => null ], 'templates' => [ 'meta' => '<meta{{attrs}}/>', 'canonical' => '<link rel="canonical" href="{{content}}"/>' ] ];
You have access to all your seo data throw the regular admin urls (ex: yoursite/admin/seo/seo-titles).
But really it's not really helpfull and even say itā¦Ā it's crappy, (*14)
A cell view is here to help you to have all the seo information directly in the view you want.
You have a product admin edit view.
in your Template/Admin/Products/edit.ctp, just add, (*15)
<?php
$cell = $this->cell('Seo.Seobox', ['uri' => Router::url(['_name' => 'catalogView', $product->slugPath])]);
echo $cell;
?>
, (*16)
In this example, I use a named route but you can use a standard array. Just remember to use the route for which you want to add Seo metas, in this case the public view of a product., (*17)
Actually, the default template doesn't respect the CakePHP default layout, and you surely want to override. To do this, just follow the conventional way., (*18)
Seo plugin for CakePHP 3
MIT
Seo plugin for CakePHP 3
MIT