diff --git a/classes/CMS.php b/classes/CMS.php index db9d69d52..13b7cac0b 100644 --- a/classes/CMS.php +++ b/classes/CMS.php @@ -34,6 +34,7 @@ class CMSCore extends ObjectModel public $link_rewrite; public $id_cms_category; public $position; + public $indexation; public $active; /** @@ -46,6 +47,7 @@ class CMSCore extends ObjectModel 'fields' => array( 'id_cms_category' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'), 'position' => array('type' => self::TYPE_INT), + 'indexation' => array('type' => self::TYPE_BOOL), 'active' => array('type' => self::TYPE_BOOL), // Lang fields diff --git a/controllers/admin/AdminCmsController.php b/controllers/admin/AdminCmsController.php index 8d77909e4..b11c21661 100644 --- a/controllers/admin/AdminCmsController.php +++ b/controllers/admin/AdminCmsController.php @@ -152,6 +152,26 @@ class AdminCmsControllerCore extends AdminController 'cols' => 40, 'hint' => $this->l('Invalid characters:').' <>;=#{}' ), + array( + 'type' => 'radio', + 'label' => $this->l('Indexation (by search engines):'), + 'name' => 'indexation', + 'required' => false, + 'class' => 't', + 'is_bool' => true, + 'values' => array( + array( + 'id' => 'indexation_on', + 'value' => 1, + 'label' => $this->l('Enabled') + ), + array( + 'id' => 'indexation_off', + 'value' => 0, + 'label' => $this->l('Disabled') + ) + ), + ), array( 'type' => 'radio', 'label' => $this->l('Displayed:'), diff --git a/controllers/front/CmsController.php b/controllers/front/CmsController.php index c5a282b00..a62047b02 100644 --- a/controllers/front/CmsController.php +++ b/controllers/front/CmsController.php @@ -110,6 +110,9 @@ class CmsControllerCore extends FrontController 'content_only' => (int)(Tools::getValue('content_only')), 'path' => $path )); + + if ($this->cms->indexation == 0) + $this->context->smarty->assign('nobots', true); } else if ($this->assignCase == 2) { diff --git a/install-dev/data/db_structure.sql b/install-dev/data/db_structure.sql index 4ad6974fc..83f0c361b 100644 --- a/install-dev/data/db_structure.sql +++ b/install-dev/data/db_structure.sql @@ -365,6 +365,7 @@ CREATE TABLE `PREFIX_cms` ( `id_cms_category` int(10) unsigned NOT NULL, `position` int(10) unsigned NOT NULL DEFAULT '0', `active` tinyint(1) unsigned NOT NULL default '0', + `indexation` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`id_cms`) ) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; diff --git a/install-dev/upgrade/sql/1.5.6.1.sql b/install-dev/upgrade/sql/1.5.6.1.sql index 92c3a8d12..1abfc03b8 100644 --- a/install-dev/upgrade/sql/1.5.6.1.sql +++ b/install-dev/upgrade/sql/1.5.6.1.sql @@ -1,3 +1,5 @@ ALTER TABLE `PREFIX_customer_message` CHANGE `ip_address` `ip_address` VARCHAR( 15 ) NULL DEFAULT NULL; UPDATE `PREFIX_orders` SET conversion_rate = 1 WHERE conversion_rate = 0; + +ALTER TABLE `PREFIX_cms` ADD `indexation` tinyint(1) UNSIGNED NULL DEFAULT '1' AFTER `active`;