Forums Forums Search & Filter Pro Issue: Form redirection to another language form + Multisite doubt

Viewing 10 posts - 1 through 10 (of 12 total)
  • Anonymous
    #103758

    Hello,

    Issue:
    I have a client site that has two languages ​​with polylang and a form in each language (this, i do not know if it is correct) that should show the results of a taxonomy in a custom post type. In Spanish language everything works fine, but when going to the other language and filtering the content by title, it ends up showing both the form and the content in Spanish.

    Details that may help:
    site link

    I have a custom post type called activities and a hierarchical taxonomy called activity_type, common to both languages ​​but with different posts in each.
    The two forms are configured by shortcode and I have three templates, one called results.php (in the local folder search-filter) that gives the format of the results, and other two (activities.php and results-search.php) I practically have the same code and I really do not know if they are needed (at least one of them) because results-search.php is the redirect of activities.php and I am using ajax.

    In activities.php I have a wp_query that sets the language of the query in your $ args but does not solve the problem.

    The shortcode is conditionally charged according to the language of the site:

    <? Php if (get_bloginfo ('language') == 'es-ES'):?>
    <H3> Buscador </ h3>
    <? Php echo do_shortcode ('[searchandfilter id = "928"]');?>
    <? Php else:?>
    <H3> Cercador </ h3>
    <? Php echo do_shortcode ('[searchandfilter id = "930"]');?>
    <? Php endif?>

    I do not know if this influences the error and it is not the right way to work, but I do not know what to do.

    One last question is whether this plugin will work in multisite.

    Many thanks and congratulations for this plugin.

    Regards.

    Trevor
    #103761

    That code is wrong, it should be:

    <?php if ( get_bloginfo('language') == 'es-ES' ):?>
    <h3>Buscador</h3>
    <?php echo do_shortcode('[searchandfilter id = "928"]');
    else:?>
    <h3>Cercador</h3>
    <?php echo do_shortcode('[searchandfilter id = "930"]');
    endif?>

    I am not sure if would work; I simply corrected the coding errors.

    Anonymous
    #103964

    Thanks for the quick reply
    I have corrected the code as you tell me, but it stays the same.
    Redirects only in Catalan language form

    Trevor
    #103974

    There are two forms there, 928 and 930. Which one is Spanish and Which one is Catalan

    Did you try echoing the language code, like this:

    <?php $blog_language = get_bloginfo('language');
    if ( $blog_language == 'es-ES' ):?>
    <h3>Buscador (language: <?php echo $blog_language;?>)</h3>
    <?php echo do_shortcode('[searchandfilter id = "928"]');
    else:?>
    <h3>Cercador (language: <?php echo $blog_language;?>)</h3>
    <?php echo do_shortcode('[searchandfilter id = "930"]');
    endif?>
    Anonymous
    #104010

    yes, but it doesn´t fix the problem altough i fixed it casualy.
    The solution was to deactivate ajax of the form in Catalan and it works
    The problem must have been ajax and some conflict that recharges erroneously.

    I have seen that if I delete the conditional that loads the shortcodes according to language, I can see the translated form, but ajax does not work in that case, however, if if I keep the conditional with the shortcodes and disable ajax in the Catalan form, ajax works (and I can also see the form in Catalan)

    What is the best way to work with a two-language form and shortcodes?

    Did not answer me but, will this work in multisite?

    Thank you

    Regards

    Trevor
    #104013

    There should be no difference between single and multisite, but you will need a license for each site that uses the plugin.

    I will ask the developer for his thoughts on this thread.

    Anonymous
    #104016

    Ok, no problem, our license is developer
    Thanks and I keep waiting for news.

    Ross Moderator
    #104173

    Hi there

    In general you should not need a conditional to display the correct form for each language,

    S&F will detect the current language and show the correct form if there is a translation.

    Although, you mention a strange ajax issue…

    Anyway, regarding the mix of languages, sometimes issues occur when taxonomies/terms are not translated.

    Did you create translations for your taxonomies and your terms in Polylang?

    If not, create translation for all, then rebuild S&F cache, and test again.

    Let me know how you get on.

    Best

    Anonymous
    #104192

    Thank you for the reply
    I have removed the language conditional in both templates and only show the shortcode of the Spanish language and displays the form that corresponds to each language. 🙂

    Regarding taxonomies, what I have translated are the terms.
    I have a taxonomy called activity_type and within 3 terms (courses, seminars and days), these terms if they have a translation.

    Polylang offers manual translation of the terms, and for taxonomy, I know it has to be activated in the polylang settings, but I only see one taxonomy common to both languages (if I change a parameter in the taxonomy in Spanish, it also changes in Catalan)

    Anonymous
    #104268

    Hi, I have a similar problem, the form works fine in English but I don’t get any results in French…
    http://www.intheloup.la

Viewing 10 posts - 1 through 10 (of 12 total)