Forums

[Plugin: Breadcrumb NavXT] qtranslate and Home link (2 posts)

  1. cyclist72
    Member
    Posted 5 months ago #

    I am using the qtranslate for a multilingual blog. It is working fine with Breadcrumb NavXT except when it comes to the home link. The home link links always (not matter what language is active) to the home page of the default language.

    But the home link of the german version should link to german home page and the italian version to the italian home page. Both lead now to the english home page since english is the default language.

    Within the navigation menu I have resolved that problem by using

    <a href="<?php echo qtrans_convertURL(get_settings('home')); ?>"> <?php _e('Home','MyTheme'); ?></a>

    How can I do this with the Breadcrumb NavXT plugin?

    Thanks a lot for your help in advance.

  2. mtekk
    Member
    Posted 5 months ago #

    I'm going to guess that what you mean is that it is not adding in the /de/, appending the ?lang=de, or using de.yourblogdomain.TLD for the home link. Does the title for the link translate correctly?

    Since you had to use the qtrans_conterURL function for the DB call to get the home URL before, any similar calls within Breadcrumb NavXT may need to be overloaded to do that as well (such call exists as get_settings('home') in the do_home and do_front_page member functions of bcn_breadcrumb_trail). The preferable solution is if qtranslate used a filter that worked in this instance, I realize that this may not be possible, or is prohibitively difficult. The other solution is creating a derived class of bcn_breadcrumb_trail and override the do_home function.

    I would recommend against modifying the actual Breadcrumb NavXT files as these changes will be lost when you upgrade to a newer version.

    Also, I should let you know that get_settings('home') should not be used as get_settings is depreciated, instead use get_option('home'), this is outside the scope of Breadcrumb NavXT but will save you headaches in the future.

Reply

You must log in to post.

About this Topic