How can I maintain compatibility between Breadcrumb NavXT and qTranslate?
-
Hello,
I’m using Breadcrumb NavXT 4.2 with qTranslate 2.5.32
My previous problem is about the Home link in the breadcrumb that keeps reverting back to default language when clicked (e.g. when I switched to Thai language I expect the home link to be mysite.com/th, not mysite.com)
I temporary fixed above problem by editing breadcrumb_navxt_class.php in your plugin directory:
1/4 line 732
$breadcrumb->set_url(get_home_url());
to
$breadcrumb->set_url(function_exists(qtrans_convertURL) ? qtrans_convertURL(get_home_url()) : get_home_url());
2/4 line 738
$breadcrumb = $this->add(new bcn_breadcrumb($this->opt[‘Smainsite_title’], $this->opt[‘Hmainsite_template’], array(‘mainsite-home’), get_home_url($current_site->blog_id)));
to
$breadcrumb = $this->add(new bcn_breadcrumb($this->opt[‘Smainsite_title’], $this->opt[‘Hmainsite_template’], array(‘mainsite-home’), function_exists(qtrans_convertURL) ? qtrans_convertURL(get_home_url($current_site->blog_id)) : get_home_url($current_site->blog_id)));
3/4 line 753
$breadcrumb = $this->add(new bcn_breadcrumb($this->opt[‘Shome_title’], $this->opt[‘Hhome_template’], array(‘site-home’), get_home_url()));
to
$breadcrumb = $this->add(new bcn_breadcrumb($this->opt[‘Shome_title’], $this->opt[‘Hhome_template’], array(‘site-home’), function_exists(qtrans_convertURL) ? qtrans_convertURL(get_home_url()) : get_home_url()));
and 4/4 line 758
$breadcrumb = $this->add(new bcn_breadcrumb($this->opt[‘Smainsite_title’], $this->opt[‘Hmainsite_template’], array(‘mainsite-home’), get_home_url($current_site->blog_id)));
to
$breadcrumb = $this->add(new bcn_breadcrumb($this->opt[‘Smainsite_title’], $this->opt[‘Hmainsite_template’], array(‘mainsite-home’), function_exists(qtrans_convertURL) ? qtrans_convertURL(get_home_url($current_site->blog_id)) : get_home_url($current_site->blog_id)));
But these fixes would definitely break when the Breadcrumb NavXT is updated.
Can you please give me some advice on how to maintain this compatibility?
Thanks
edit: I can’t use strong in code tag to highlight the changed code, so I used blockquote tag instead.
- The topic ‘How can I maintain compatibility between Breadcrumb NavXT and qTranslate?’ is closed to new replies.