Home Документация Как да Some tricks on changing title, meta tags etc.
Some tricks on changing title, meta tags etc. ПДФ Печат Е-мейл
Написано от Rune Rasmussen   
Сряда, 25 Април 2007 23:21
NO TRANSLATION AVAILABLE

This article relates to Joomfish 1.8 and Joomla 1.0 and is not relevant to Joomfish 2.0 on Joomla 1.5. In Joomfish 2.0 you should use the language configuration to change site title and global meta tags.

Site title, meta tags and other text/settings in the configuration.php file (+ other globals in the core ;)) can be overrided in the core language files (located in ../language/).

First you should ensure that your template's index.php file have the line
<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php echo _LANGUAGE; ?>" 
xml:lang="<?php echo _LANGUAGE; ?>"> 
- who tells browsers and search engines which language to read, t.ex. useful to get the different languages indexed by Google.

eg. The top of your index should look something like:

<?php defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php echo _LANGUAGE; ?>"
xml:lang="<?php echo _LANGUAGE; ?>"> 
<head> 

Then to override site title and meta tags add to your language files:

$mosConfig_sitename = 'Your site title in other language..'; 
$mosConfig_MetaDesc = 'Your description in other language..'; 
$mosConfig_MetaKeys = 'Your meta keys in other language..'; 

You can also make {language}.override.php files (t.ex english.override.php) and upload them to your language folder.
Nice to avoid overwriting your customizations if the core language files changes, as they will in Joomla! 1.0.12 t.ex.
Then you just need to add an if query in the core language files:

if(file_exists($mosConfig_absolute_path.'/language/'.$mosConfig_lang.'.override.php')) 
require_once($mosConfig_absolute_path.'/language/'.$mosConfig_lang.'.override.php'); 

Tested and working on Joomla! 1.0.12 and Joom!Fish 1.7

Please Note!

There can be some issues with site titles on some 3.pd. components where it's not translated.
 

2 Comments

  1. Hi, This is already implemented in Joom!Fish 2.0 - just go to the language manager and there is a function to translate the configuration. All you need to do is to translate it and you are done. Cheers
  2. What would be the solution to Joomla 1.5? Where should I add the if query?

Add Comment

Joom!Fish 2.0 RC download

Избрани сътрудници

От екипа на Джум!Фиш (Алекс, Герайнт, Иво & Робин), голямо благодарим към цялата Джум!Фиш общност. Специални благодарност за тестването, предложенията, преводите и модерирането към:

  • Томи Уай за сладкото лого
  • Бернхард, Майкъл, Люк, Оливие, Робин, Руне, Акаравут
  • Хари (Тасу) за модерирането

Recommended Reading

Buy Joomla! 1.5 with directshopper