s...@ull.at
unread,Jun 24, 2014, 5:58:33 AM6/24/14Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ullrigh...@googlegroups.com
Author: klemens
Date: 2014-06-24 11:58:32 +0200 (Tue, 24 Jun 2014)
New Revision: 4112
Added:
trunk/plugins/ullCmsPlugin/modules/ullCms/templates/_cms_html_metas.php
trunk/plugins/ullCorePlugin/lib/migrations/1403593940_add_ull_cms_metas.php
trunk/plugins/ullCorePlugin/modules/default/templates/_html_metas.php
Modified:
trunk/plugins/ullCmsPlugin/config/doctrine/ullCmsSchema.yml
trunk/plugins/ullCmsPlugin/i18n/ullCmsMessages.de.xml
trunk/plugins/ullCmsPlugin/lib/generator/columnConfigCollection/base/BaseUllCmsPageColumnConfigCollection.class.php
trunk/plugins/ullCmsPlugin/modules/ullCms/templates/showSuccess.php
Log:
ullCms: added support for html head meta keywords and description
Modified: trunk/plugins/ullCmsPlugin/config/doctrine/ullCmsSchema.yml
===================================================================
--- trunk/plugins/ullCmsPlugin/config/doctrine/ullCmsSchema.yml 2014-06-20 07:57:55 UTC (rev 4111)
+++ trunk/plugins/ullCmsPlugin/config/doctrine/ullCmsSchema.yml 2014-06-24 09:58:32 UTC (rev 4112)
@@ -46,7 +46,12 @@
image:
type: string(255)
gallery:
- type: string(4000)
+ type: string(4000)
+ # html head metas
+ keywords:
+ type: string(255)
+ description:
+ type: string(1000)
# page and content_block columns
ull_cms_content_type_id:
Modified: trunk/plugins/ullCmsPlugin/i18n/ullCmsMessages.de.xml
===================================================================
--- trunk/plugins/ullCmsPlugin/i18n/ullCmsMessages.de.xml 2014-06-20 07:57:55 UTC (rev 4111)
+++ trunk/plugins/ullCmsPlugin/i18n/ullCmsMessages.de.xml 2014-06-24 09:58:32 UTC (rev 4112)
@@ -238,6 +238,16 @@
<target>Bilder</target>
</trans-unit>
+<trans-unit id="48">
+<source>Meta keywords</source>
+<target>Meta Keywords</target>
+</trans-unit>
+
+<trans-unit id="49">
+<source>Meta description</source>
+<target>Meta Description</target>
+</trans-unit>
+
<trans-unit id="">
<source></source>
<target></target>
@@ -248,6 +258,16 @@
<target></target>
</trans-unit>
+<trans-unit id="">
+<source></source>
+<target></target>
+</trans-unit>
+
+<trans-unit id="">
+<source></source>
+<target></target>
+</trans-unit>
+
</body>
</file>
</xliff>
\ No newline at end of file
Modified: trunk/plugins/ullCmsPlugin/lib/generator/columnConfigCollection/base/BaseUllCmsPageColumnConfigCollection.class.php
===================================================================
--- trunk/plugins/ullCmsPlugin/lib/generator/columnConfigCollection/base/BaseUllCmsPageColumnConfigCollection.class.php 2014-06-20 07:57:55 UTC (rev 4111)
+++ trunk/plugins/ullCmsPlugin/lib/generator/columnConfigCollection/base/BaseUllCmsPageColumnConfigCollection.class.php 2014-06-24 09:58:32 UTC (rev 4112)
@@ -102,8 +102,19 @@
$this['duplicate_tags_for_search']
->setLabel('Tags')
->setMetaWidgetClassName('ullMetaWidgetTaggable')
- ;
+ ;
+ $this['keywords']
+ ->setLabel(__('Meta keywords', null, 'ullCmsMessages'))
+ ;
+
+ $this['description']
+ ->setLabel(__('Meta description', null, 'ullCmsMessages'))
+ ->setMetaWidgetClassName('ullMetaWidgetString')
+ ;
+
+
+
if ($this->isCreateAction())
{
$this['ull_cms_content_type_id']
@@ -111,5 +122,41 @@
->findOneBySlug('default')->id)
;
}
+
+ $this->order(array(
+ array(
+ 'title',
+ 'name',
+ ),
+ array(
+ 'body',
+ ),
+ array(
+ 'preview_image',
+ 'image',
+ 'gallery',
+ ),
+ array(
+ 'parent_ull_cms_item_id',
+ 'sequence',
+ 'is_active',
+ ),
+ array(
+ 'duplicate_tags_for_search',
+ 'keywords',
+ 'description',
+ ),
+ array(
+ 'slug',
+ 'id',
+ 'ull_cms_content_type_id',
+ 'creator_user_id',
+ 'created_at',
+ 'updator_user_id',
+ 'updated_at',
+ 'type',
+ ),
+ ));
+
}
}
\ No newline at end of file
Added: trunk/plugins/ullCmsPlugin/modules/ullCms/templates/_cms_html_metas.php
===================================================================
--- trunk/plugins/ullCmsPlugin/modules/ullCms/templates/_cms_html_metas.php (rev 0)
+++ trunk/plugins/ullCmsPlugin/modules/ullCms/templates/_cms_html_metas.php 2014-06-24 09:58:32 UTC (rev 4112)
@@ -0,0 +1,20 @@
+<?php // Handle ullCms html head keywords and description ?>
+<?php // Use keywords and description of the current cms page ?>
+<?php // or fallback to defaults defined in apps/frontend/config/app.yml ?>
+<?php // This partial is to be included in ullCms templates like showSuccess.php ?>
+<?php // Params: give the current cms page as $doc ?>
+
+<?php slot('html_head_metas') ?>
+
+ <meta name="keywords" content="<?php
+ echo (($doc['keywords']) ?
+ $doc['keywords'] :
+ sfConfig::get('app_default_html_meta_keywords')
+ ) ?>" />
+ <meta name="description" content="<?php
+ echo (($doc['description']) ?
+ $doc['description'] :
+ sfConfig::get('app_default_html_meta_description')
+ ) ?>" />
+
+<?php end_slot() ?>
\ No newline at end of file
Modified: trunk/plugins/ullCmsPlugin/modules/ullCms/templates/showSuccess.php
===================================================================
--- trunk/plugins/ullCmsPlugin/modules/ullCms/templates/showSuccess.php 2014-06-20 07:57:55 UTC (rev 4111)
+++ trunk/plugins/ullCmsPlugin/modules/ullCms/templates/showSuccess.php 2014-06-24 09:58:32 UTC (rev 4112)
@@ -1,3 +1,5 @@
+<?php include_partial('ullCms/cms_html_metas', array('doc' => $doc))?>
+
<?php slot('sidebar') ?>
<?php echo $sidebar_menu ?>
<?php end_slot() ?>
Added: trunk/plugins/ullCorePlugin/lib/migrations/1403593940_add_ull_cms_metas.php
===================================================================
--- trunk/plugins/ullCorePlugin/lib/migrations/1403593940_add_ull_cms_metas.php (rev 0)
+++ trunk/plugins/ullCorePlugin/lib/migrations/1403593940_add_ull_cms_metas.php 2014-06-24 09:58:32 UTC (rev 4112)
@@ -0,0 +1,15 @@
+<?php
+
+class AddUllCmsMetas extends Doctrine_Migration_Base
+{
+ public function up()
+ {
+ $this->addColumn('ull_cms_item', 'keywords', 'string', 255);
+ $this->addColumn('ull_cms_item', 'description', 'string', 2000);
+ }
+
+ public function down()
+ {
+
+ }
+}
Added: trunk/plugins/ullCorePlugin/modules/default/templates/_html_metas.php
===================================================================
--- trunk/plugins/ullCorePlugin/modules/default/templates/_html_metas.php (rev 0)
+++ trunk/plugins/ullCorePlugin/modules/default/templates/_html_metas.php 2014-06-24 09:58:32 UTC (rev 4112)
@@ -0,0 +1,12 @@
+<?php // Handle html meta keywords & description ?>
+<?php // Defaults are set in apps/frontend/config/app.yml ?>
+<?php // This file may be included in _html_head.(mobile.)php ?>
+
+<?php $default_html_head_metas =
+ '<meta name="description" content="' .
+ sfConfig::get('app_default_html_meta_description') . '" />' . "\n" .
+ '<meta name="keywords" content="' .
+ sfConfig::get('app_default_html_meta_keywords') . '" />' . "\n"
+?>
+
+<?php include_slot('html_head_metas', $default_html_head_metas) ?>
\ No newline at end of file