Welcome Guest, Not a member yet? Register   Sign In
URI Language Identifier and paths

I'm using URI Language Identifier to build up a multilanguage website. English is the default language. The url of the homepage is, let's say, something similar to


In the homepage there is a set of categories of products, each of them linked to the page with the relative list. For example


To achieve that this is the html:

<a href="objects/catalog/&lt;?= $id ?&gt;.html">&lt;?= $category ?&gt;</a>

It works fine. But if I want to copy the same list of categories in internal pages, I have a problem of path. In fact previous html code tends to add the query string to the current one, that is great in the homepage, but doesn't work in internal page
In other hand, if I try with

<a href="/objects/catalog/&lt;?= $id ?&gt;.html">&lt;?= $category ?&gt;</a>


<a href="../../objects/catalog/&lt;?= $id ?&gt;.html">&lt;?= $category ?&gt;</a>

I have other different problem. The only solution I've found it's

<a >config->item('language'), $this->config->item('lang_uri_abbr')) ?&gt;/objects/catalog/&lt;?= $id ?&gt;.html">&lt;?= $category ?&gt;</a>

But it's annoying to repeat for every link. Any suggestion?

i would suggest using the url helper for generating links
<a href="php site_url('controller/method') php">link</a>

if you then need some additional informations for the link url you can just
overwrite the site_url function by putting a url_helper.php in your application/helpers
directory which implements the desired functionality..

function site_url($str)
   $CI =& get_instance();
    //retrieve your language key etc
    $lang = ...
   return $CI->config->site_url($lang . $uri);

Theme © iAndrew 2016 - Forum software by © MyBB