Forums / General / Multilingual meta tags

Multilingual meta tags

Author Message

Paul Kemper

Tuesday 25 November 2008 11:06:07 pm

Hi all,

I am impressed with eZ and it's multilingual capabilities.

However: I could not find any reference to multilingual meta tags. I did see the descriptions on multi-lingual page content, admin interface, URL aliases.

But can I also have the page title, description/keyword meta tag in a translated version?

Paul Kemper
http://www.tauros.eu

Frédéric DAVID

Wednesday 26 November 2008 1:15:58 am

The page title is already translated.

For description/keyword meta tag, if you have your website in different siteaccess, you can define foreach site different meta tags.

For example, if you have a siteaccess fr, language used is french. You put in your site.ini

MetaDataArray[description]=Système de Gestion de Contenu
MetaDataArray[keywords]=cms, publish, e-commerce, gestion de contenu

and in a siteaccess en, language used is english. You put in your site.ini

MetaDataArray[description]=Content Management System
MetaDataArray[keywords]=cms, publish, e-commerce, content management

Blog : http://www.frefred.fr/blog/ez-publish
feZ Meta Data : http://projects.ez.no/fezmetadata

Arnaud Lafon

Wednesday 26 November 2008 1:37:02 am

Hi Paul,

all the metas are usually built by a template called page_head.tpl and you'll be able to override it. So If you define some class attribute like "site_title" or "site_metas" and enable translation, then you'll be able to customize your <meta /> and <title> tags for all your page.

Looking for information about SQLI ?
Looking for a new job in Paris ?
Please contact me at alafon [at] sqli [dot] com

Paul Kemper

Wednesday 26 November 2008 1:57:29 am

Contrary to Frédéric's example, I assume that every page in my site can have different meta tag contents. Am I correct?

Paul Kemper
http://www.tauros.eu

Arnaud Lafon

Wednesday 26 November 2008 2:08:48 am

Yes it's possible. You'll have to modify the page_head template, but it's quite simple.

Looking for information about SQLI ?
Looking for a new job in Paris ?
Please contact me at alafon [at] sqli [dot] com

Paul Kemper

Wednesday 26 November 2008 2:59:35 am

Thanx Arnaud,

I will dive in and see if I can get a sample to work.

Kind regards,

Paul Kemper
http://www.tauros.eu

Arnaud Lafon

Wednesday 26 November 2008 4:26:11 am

You're welcome. Just let me know If you need more information about this.

Looking for information about SQLI ?
Looking for a new job in Paris ?
Please contact me at alafon [at] sqli [dot] com

Greg Lakomy

Tuesday 02 December 2008 12:21:37 pm

You could also use global persistent_variable and set your title/keywords/description on individual objects and then pass those values back to page_layout or page_head

Example:

Set this in your template:

{set scope=global $persistent_variable=hash(
		'seo_description',$node.object.data_map.description, 
		'seo_keywords', $node.object.data_map.keywords, 
		'seo_title', $node.object.data_map.title)}

Retrieve in page_head:

{$module_result.content_info.persistent_variable['seo_title'].content|wash}

Developer
http://www.duoconsulting.com

Gaetano Giunta

Tuesday 02 December 2008 3:29:55 pm

I second Greg's solution - it allows to have different meta tags per every content object without creating a mess of ini settings or having to fecth the current node again in the pagelayout. Plus, since objects are translated, you will have automatically translated the meta-tags, too.

Just remember that you will have to add the template code that sets the persistent variable to every template overriding node/view/full of your website, or at least for all the content classes that have the meta-tags attributes.

An also remember to check in the pagelayout to see if the persistent var has been populated before using it. When you access a module other than content (such as user/login) it will not contain your meta-tags data.

Principal Consultant International Business
Member of the Community Project Board

eZ debug

Timing: Jan 18 2025 05:09:43
Script start
Timing: Jan 18 2025 05:09:43
Module start 'content'
Timing: Jan 18 2025 05:09:44
Module end 'content'
Timing: Jan 18 2025 05:09:44
Script end

Main resources:

Total runtime1.2918 sec
Peak memory usage4,096.0000 KB
Database Queries218

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 587.6016180.8516
Module start 'content' 0.00721.0887 768.4531736.0391
Module end 'content' 1.09600.1957 1,504.4922344.4531
Script end 1.2917  1,848.9453 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00490.3797210.0002
Check MTime0.00170.1321210.0001
Mysql Total
Database connection0.00110.081710.0011
Mysqli_queries1.170590.60802180.0054
Looping result0.00250.19392160.0000
Template Total1.256797.320.6283
Template load0.00190.145920.0009
Template processing1.254897.134820.6274
Template load and register function0.00010.008310.0001
states
state_id_array0.00080.058810.0008
state_identifier_array0.00260.202320.0013
Override
Cache load0.00170.1312480.0000
Sytem overhead
Fetch class attribute can translate value0.00170.134360.0003
Fetch class attribute name0.00200.1567130.0002
XML
Image XML parsing0.00350.270860.0006
class_abstraction
Instantiating content class attribute0.00010.0044170.0000
General
dbfile0.00710.5464460.0002
String conversion0.00000.000430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
8content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
9content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
12content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 35
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs