• Resolved helenagwyn

    (@helenagwyn)


    I have a multilingual website with WPML using Pods with Custom Types and its templates. I was able to get my templates translated and used on the different languages by unchecking “Adjust IDs for multilingual functionality”. But I’ve searched around a bit but can’t seem to find an solution for my issues.

    I want to print a list of pages which I extended with a checkbox to have it show up in the specific list. I use the ‘Pods Item List’-block. For every page it prints all the languages. How can I limit it to only a chosen language or maybe the language of the template?

    I want to print a list of custom categories and underneath each category the associated post-types. I use the ‘Pods Item List’-block with the custom categories. I always prints the links to the categories and post-types in the standard language although the categories and post-types are translated. How do I specify to use which language or reference to the translated values of the taxonomies or post-types?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @helenagwyn

    Just to be sure I understand correctly. You created a CPT that is set to be translated and within that CPT you have a relationship field that is being synched between translations?
    If so, this isn’t supported just yet. I did finish an integration with Polylang a while a go but WPML is still todo.

    Let me know if I understood you case correctly!

    Cheers, Jory

    Thread Starter helenagwyn

    (@helenagwyn)

    I did two things:

    1. Extended the Pages (WordPress core) with a checkbox.
    I use a Pods Item List Block with a template to show pages with this checkbox checked. It lists the pages in all languages. So if I translated a page into two other languages, it is shown three times.

    2. Created a CPT. I use a Pods Item List Block to show them. Same thing happens. It lists all the custom posts, not just the one in the current language.

    I worked around this by extending everything with a language-field and translating the templates with each template filtering on this field.

    And I created a few functions to get the translated content.

    function pods_wpml_permalink($p) {
    return apply_filters( ‘wpml_permalink’, $p, apply_filters( ‘wpml_current_language’, null ), true );
    }

    function pods_wpml_post_title($id) {
    return apply_filters( ‘wpml_get_element_translations’, array(), apply_filters( ‘wpml_element_trid’, false, $id, ‘post_post’ ), ‘post_post’ )[apply_filters( ‘wpml_current_language’, null )]->post_title;
    }

    function pods_wpml_taxonomy_name($id) {
    return apply_filters( ‘wpml_get_element_translations’, array(), apply_filters( ‘wpml_element_trid’, false, $id, ‘tax_aanbod-categorie’ ), ‘tax_aanbod-categorie’ )[apply_filters( ‘wpml_current_language’, null )]->name;
    }

    WPML-support referred me to this post https://wpml.org/forums/topic/wp_query/#post-10163421 mentioning the ‘suppress_filters’ attribute needed. Don’t know how Pods implements this in the background. Or whether there are other workarounds at the moment.
    Currently I’m only using Pods-templates with Blocks. Maybe building my own in PHP might give me more options. But haven’t dived into Pods using PHP yet.

    Another issue I encountered is the filter with Pods Item List Block. It filters all the Pods Item List blocks on a page, not just the one for which you enabled the filter. But maybe I should open another ticket for this?

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @helenagwyn

    I’ve just tested this locally and cannot reproduce your issue.
    Both backend and frontend only show items that are in the same language as the Page I’m on.
    Can you reproduce this issue with only WPML and Pods activated?

    Another issue I encountered is the filter with Pods Item List Block. It filters all the Pods Item List blocks on a page, not just the one for which you enabled the filter. But maybe I should open another ticket for this?

    This is indeed unrelated and sounds like a bug. Could you report this here? pods.io/submit
    Please provide all steps and examples needed so we can easily reproduce the issue.

    Cheers, Jory

    Thread Starter helenagwyn

    (@helenagwyn)

    Hi, apparently by checking “Adjust IDs for multilingual functionality” again, it started behaving as aspected. When looking for a solution before I came across a post saying it had to be unchecked. I assume that post was to old and that my wordpress memory limit was to low at first. That’s one thing I did change. So everything is working fine now. Thanks.

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @helenagwyn

    Yeah our integration relies on this function so that would definitely be the fix here!

    Cheers, Jory

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to use WPML-translation in Pods-templates’ is closed to new replies.