-
AuthorPosts
-
April 26, 2012 at 8:49 pm #176519
I am using Joomla 2.5.4 and VM2 2.0.6 with the Puresite template and 2 languages. First, SH404SEF did not work so I gave up on that and went to the default SEF built into the Joomla and VM2. Works great so far…
Can someone help with how the change the Puresite template to support going to selected language homepage when clicking on the main logo (same logo for both languages). Currently it goes to the same default language only (English).
pavit Moderatorpavit
- Join date:
- September 2007
- Posts:
- 15749
- Downloads:
- 199
- Uploads:
- 2274
- Thanks:
- 417
- Thanked:
- 4028 times in 3778 posts
April 26, 2012 at 9:03 pm #450394Hi
Help me to understand, you want this
1) Home page english – click on logo and redirect to the other language Home
2) Home page in other language – click on logo and redirect in the English Home
Correct ?
April 27, 2012 at 6:36 am #450453When I go to the site, the default language is English. As I go around the site, if I click on the site logo on the upper left corner, it goes back to the English home page. This is correct.
When I go to the site and select German as the language, the page turns to German as it should…but when I click on the site logo (same as above, the page turns back to English. I can go around the site in German, but from anywhere on the site, if I click on the logo, it goes back to the English homepage…but it should go to the German homepage as I’ve selected German as my language.
pavit Moderatorpavit
- Join date:
- September 2007
- Posts:
- 15749
- Downloads:
- 199
- Uploads:
- 2274
- Thanks:
- 417
- Thanked:
- 4028 times in 3778 posts
April 27, 2012 at 7:22 am #450461Please send me via PM your super user account to the backend i will check this situation
pavit Moderatorpavit
- Join date:
- September 2007
- Posts:
- 15749
- Downloads:
- 199
- Uploads:
- 2274
- Thanks:
- 417
- Thanked:
- 4028 times in 3778 posts
April 27, 2012 at 10:34 am #450502I found that thread also and was going to included in my original post…but it’s using a different method to make the link. I am not familar with how to change this statement in the header.php file…can you help:
<h1 class="logo">
<a href="<?php JURI::base(true) ?>" title="<?php echo $siteName; ?>">
<img src="<?php echo 'templates/'.T3_ACTIVE_TEMPLATE.'/images/logo-trans.png' ?>" alt="<?php echo $siteName; ?>" />
</a>
</h1>The above is the part I think that needs to be changed…the other thread is referring to an /index.php which is in this case JURI::base(true)
Thanks
pavit Moderatorpavit
- Join date:
- September 2007
- Posts:
- 15749
- Downloads:
- 199
- Uploads:
- 2274
- Thanks:
- 417
- Thanked:
- 4028 times in 3778 posts
April 27, 2012 at 10:50 am #450507<blockquote>I am not familar with how to change this statement in the header.php file…can you help:</blockquote>
Just change the actual line of code in the header.php with the one you showed above make your changes and test
Take first a backup of the header.php file
April 27, 2012 at 11:31 am #450515The code above returns a ‘ / ‘ as the output…but the actual required output for the German homepage as I can see is ‘ /index.php/de/ ‘
This was my question was what other method to get to ‘ /index.php/de/ ‘ (I assume the ‘de’ would change depending on the language).
April 27, 2012 at 12:56 pm #450522Here’s the solution I’ve gone with as it seems to work. I found it going through the Joomla forum and applied it to this template…If there is a better/more elegant solution, please let me know…
Added this before the logo class:
$language = JFactory::getLanguage();
$params = JComponentHelper::getParams("com_languages");
if ( $language->getTag() == $params->get("site", "en-GB") ) {
$tmp->url = JURI::base();
} else {
$lang_code_partials = explode("-", $language->getTag());
$lang_prefix = array_shift($lang_code_partials);
$tmp->url = JURI::base()."index.php/".$lang_prefix;
}
to add the ‘de’ to the end of the base URL if it’s not English…
then changed the ..
<a href="<?php JURI::base(true) ?>
to
<a href="<?php echo $tmp->url; ?>
in the two locations in the template….(logo/text)
-
AuthorPosts
This topic contains 9 replies, has 2 voices, and was last updated by alwayzfun 12 years, 7 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum