From 202969fde9e5c73f0247d856ac2504c1f71e667b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Espeche?= Date: Thu, 26 Jun 2014 14:25:04 +0200 Subject: [PATCH] Add store_description field for SEO --- core/lib/Thelia/Config/I18n/en_US.php | 1 + core/lib/Thelia/Config/I18n/fr_FR.php | 1 + core/lib/Thelia/Config/I18n/it_IT.php | 1 + .../Admin/ConfigStoreController.php | 1 + core/lib/Thelia/Form/ConfigStoreForm.php | 7 +++++++ setup/insert.sql | 1 + .../backOffice/default/config-store.html | 20 ++++++++++++++----- templates/frontOffice/default/layout.tpl | 4 +++- 8 files changed, 30 insertions(+), 6 deletions(-) diff --git a/core/lib/Thelia/Config/I18n/en_US.php b/core/lib/Thelia/Config/I18n/en_US.php index 6b92a7fb6..44a59c4a1 100644 --- a/core/lib/Thelia/Config/I18n/en_US.php +++ b/core/lib/Thelia/Config/I18n/en_US.php @@ -271,6 +271,7 @@ return array( 'Store logs into text file' => 'Store logs into text file', 'Store logs into text file, up to a certian size, then a new file is created' => 'Store logs into text file, up to a certian size, then a new file is created', 'Store name' => 'Store name', + 'Store description' => 'Store description', 'Street Address' => 'Street Address', 'Street Address ' => 'Street Address ', 'Strictly use the requested language' => 'Strictly use the requested language', diff --git a/core/lib/Thelia/Config/I18n/fr_FR.php b/core/lib/Thelia/Config/I18n/fr_FR.php index bd789a0ad..1efcd9824 100644 --- a/core/lib/Thelia/Config/I18n/fr_FR.php +++ b/core/lib/Thelia/Config/I18n/fr_FR.php @@ -271,6 +271,7 @@ return array( 'Store logs into text file' => 'Conserver les logs dans des fichiers texte', 'Store logs into text file, up to a certian size, then a new file is created' => 'Sauvegarder les logs dans un fichier texte. A partir d\'une certaine taille un nouveau fichier est créé', 'Store name' => 'Nom du magasin', + 'Store description' => 'Description du magasin', 'Street Address' => 'Adresse', 'Street Address ' => 'Rue', 'Strictly use the requested language' => 'Utiliser strictement la langue demandée', diff --git a/core/lib/Thelia/Config/I18n/it_IT.php b/core/lib/Thelia/Config/I18n/it_IT.php index 265f136eb..aaf07cd43 100644 --- a/core/lib/Thelia/Config/I18n/it_IT.php +++ b/core/lib/Thelia/Config/I18n/it_IT.php @@ -160,6 +160,7 @@ return array( 'Store logs into text file' => 'Archiviare i log in un file di testo', 'Store logs into text file, up to a certian size, then a new file is created' => 'Archiviare i log in un file di testo, fino ad una certa dimensione, dopo viene creato un nuovo file', 'Store name' => 'Nome del negozio', + 'Store description' => 'Descrizione del negozio', 'Street Address' => 'Indirizzo', 'Street Address ' => 'Indirizzo ', 'Strictly use the requested language' => 'Utilizzare rigorosamente la lingua richiesta', diff --git a/core/lib/Thelia/Controller/Admin/ConfigStoreController.php b/core/lib/Thelia/Controller/Admin/ConfigStoreController.php index e76959864..0e7fb8090 100644 --- a/core/lib/Thelia/Controller/Admin/ConfigStoreController.php +++ b/core/lib/Thelia/Controller/Admin/ConfigStoreController.php @@ -36,6 +36,7 @@ class ConfigStoreController extends BaseAdminController // Hydrate the store configuration form $configStoreForm = new ConfigStoreForm($this->getRequest(), 'form', array( 'store_name' => ConfigQuery::read("store_name"), + 'store_description' => ConfigQuery::read("store_description"), 'store_email' => ConfigQuery::read("store_email"), 'store_business_id' => ConfigQuery::read("store_business_id"), 'store_phone' => ConfigQuery::read("store_phone"), diff --git a/core/lib/Thelia/Form/ConfigStoreForm.php b/core/lib/Thelia/Form/ConfigStoreForm.php index b7b49b2a0..ee9eb193e 100644 --- a/core/lib/Thelia/Form/ConfigStoreForm.php +++ b/core/lib/Thelia/Form/ConfigStoreForm.php @@ -29,6 +29,13 @@ class ConfigStoreForm extends BaseForm "for" => "store_name" ) )) + ->add("store_description", "text", array( + "label" => Translator::getInstance()->trans('Store description'), + "label_attr" => array( + "for" => "store_description" + ), + "required" => false + )) ->add("store_email", "text", array( "constraints" => array( new Constraints\NotBlank(), diff --git a/setup/insert.sql b/setup/insert.sql index d5ae99111..8e74b3804 100644 --- a/setup/insert.sql +++ b/setup/insert.sql @@ -39,6 +39,7 @@ INSERT INTO `config` (`name`, `value`, `secured`, `hidden`, `created_at`, `updat ('session_config.default', '1', 1, 1, NOW(), NOW()), ('default_lang_without_translation', '1', 1, 1, NOW(), NOW()), ('store_name','', 0, 1, NOW(), NOW()), +('store_description','', 0, 1, NOW(), NOW()), ('store_email','', 0, 1, NOW(), NOW()), ('one_domain_foreach_lang','0', 1, 1, NOW(), NOW()), ('thelia_version','2.0.2', 1, 1, NOW(), NOW()), diff --git a/templates/backOffice/default/config-store.html b/templates/backOffice/default/config-store.html index dd648a943..61e302e8e 100644 --- a/templates/backOffice/default/config-store.html +++ b/templates/backOffice/default/config-store.html @@ -56,13 +56,23 @@
{form_field form=$form field='store_name'} -
- +
+ -
- -
+
+
+
+ {/form_field} + + {form_field form=$form field='store_description'} +
+ + +
+ +
+
{/form_field} {form_field form=$form field='store_business_id'} diff --git a/templates/frontOffice/default/layout.tpl b/templates/frontOffice/default/layout.tpl index 8a2d06a4c..fcc78b3b7 100644 --- a/templates/frontOffice/default/layout.tpl +++ b/templates/frontOffice/default/layout.tpl @@ -27,7 +27,9 @@ GNU General Public License : http://www.gnu.org/licenses/ {block name="no-return-functions"}{/block} {assign var="store_name" value="{config key="store_name"}"} +{assign var="store_description" value="{config key="store_description"}"} {if not $store_name}{assign var="store_name" value="{intl l='Thelia V2'}"}{/if} +{if not $store_description}{assign var="store_description" value="$store_name"}{/if} {* paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither *} @@ -49,7 +51,7 @@ GNU General Public License : http://www.gnu.org/licenses/ {block name="meta"} - + {/block}