Internationalization addon broke the "Home" link in my theme.
Permalink 2 users found helpful
I used to automatically link to the homepage. Now, after installing internationalization, I need to change that so that it links to the actual language's homepage, not the "top" homepage (which redirects to the default language's home).
What should I change?
Thanks in advance.
<a href="<?php echo DIR_REL?>/">
What should I change?
Thanks in advance.
In Dashboard click at "Multilingual" and then select "Redirect home page to default language section." at the bottom.
Maybe I wasn't clear, so here is what I want to do:
I want my logo to link to the home page. In a single language site, it was easy, because the DIR_Rel spat out the correct address, no matter what the actual URL was.
I want the same with a multi-language site, so that the logo links back the _selected_ language's home page.
I want to do hardcode this into the theme's header.php.
Thanks.
I want my logo to link to the home page. In a single language site, it was easy, because the DIR_Rel spat out the correct address, no matter what the actual URL was.
I want the same with a multi-language site, so that the logo links back the _selected_ language's home page.
I want to do hardcode this into the theme's header.php.
Thanks.
Ah - ok. I didn't quite get that in the first place. If you want to get the home page of the current pages language-section do this:
The first "if" is only necessary to be prevent your theme from breaking if the internationalization add-on is disabled.
<?php $home = DIR_REL; if ( Package::getByHandle('multilingual') ) { $ms = MultilingualSection::getCurrentSection(); if (is_object($ms)) { $home = Loader::helper('navigation')->getLinkToCollection($ms, true); } }?> <h1><a href="<?=$home?>" >HOME</a></h1>
The first "if" is only necessary to be prevent your theme from breaking if the internationalization add-on is disabled.
Thanks! That is exactly what I need.
Thanks a lot!
I've been using this code for a while now without a hitch, but since internationalization v1.2, this doesn't work anymore (or is it C5.6.1.2?)
<?=$home?> is plain text the URL instead of the variable.
Anyone have any ideas?
<?=$home?> is plain text the URL instead of the variable.
Anyone have any ideas?