Home›Support›English Support›[Resolved] Assistance with Bricks Theme: Template Conditions Not Applied Correctly in Translated Templates
[Resolved] Assistance with Bricks Theme: Template Conditions Not Applied Correctly in Translated Templates
This thread is resolved. Here is a description of the problem and solution.
Problem: You are trying to apply template conditions in the Bricks Theme to display only for specific terms, such as a particular category, but the condition does not apply correctly in the translated templates. This issue occurs with a template for a custom post type post. Solution: If you're experiencing this issue, we recommend you try the following steps: 1. Go to WPML-> Settings-> Custom Fields Translation section 2. Click "Show System Fields" 3. Search for the "_bricks_template_settings" field 4. Set as Copy Once and save 5. Edit the template in the default language 6. Make a minor edit and update it 7. Switch the language using the top admin bar 8. Edit the translated template using Bricks 9. Edit the translated template display conditions 10. Select the translated term and save it We tried these steps on the Asia template, which resolved the issue in this language. Please try the steps from Step 7 in other languages and let us know if that fixes the issue.
Please note that this solution might be irrelevant if it's outdated or not applicable to your case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket at WPML support forum.
0% of people find this useful.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Background of the issue:
I am trying to apply template conditions in the Bricks Theme to display only for specific terms, such as a particular category, but the condition does not apply correctly in the translated templates. I am experiencing this issue with a template for a custom post type post. I have implemented the workaround suggested here: https://wpml.org/errata/bricks-theme-template-conditions-not-applied-correctly-in-translated-templates/comment-page-1/?unapproved=9065985&moderation-hash=9f2364b11a4be5f815395cc531d02e51. I also tried translating the template using the WordPress editor and resaving settings and translations after the change but this didn’t resolve the issue. The design created with a single template in the English version is not applied across translations, as seen in the example where it doesn’t work: hidden link.
Symptoms:
The template condition does not apply correctly in the translated templates. The design created with a single template in the English version is not applied across translations.
Questions:
Is there something else I can try to resolve the issue with template conditions not applying correctly in translated templates?
I would gladly follow the steps you suggested but unfortunately we only have one license for Bricks that we need for our website so I won't be able to install it on your sandbox site.
The issue is already visible on the staging website I provided credentials for (if you don't see them in this ticket, let me know and I'll send them immediately).
You can see the issue by checking the single case study template in wp-admin -> Bricks -> Templates -> Single Post Template – Case Studies.
Its conditions are set to display the template for all posts from the post type Library in the term Case Studies. It's assigned correctly but the design is applied only for the main (US) version. All other languages don't follow that design.
Here is an example: hidden link (US) and hidden link (Asia).
Would this information be enough for you to troubleshoot?
I answered yesterday but it seems it wasn't posted.
Unfortunately, despite my efforts to replicate the setup on your site, there are many other plugins and settings that are needed to do so and I can't seem to implement it.
However, I did notice something that I believe might be the cause. The way the template works when synced between languages is that it uses the category ID in template conditions. That ID should remain the same for all languages for it to work.
On the main language, the term was added manually and is Case studies (Library Categories) with ID 4. This value in the other language templates is library-category::4. However, this term ID isn't the same for the other language versions. The Case studies term has been translated using WPML translation and from the category panel, so they are linked.
Is the default WPML behavior to have different IDs for translated terms?
If it's possible to have the same ID for the case studies term across languages I belive the issue would be fixed.
Having this information, do you have any solutions in mind?
I checked this post and indeed the design is as per the template and as expected.
Perhaps the change you implemented is only applied to the post you shared but I just wanted to let you know that all other language versions of it aside from Asia & US aren't fixed, as well as all other posts.
Could you please let me know what you did so that I can try to implement it for all versions and posts?
1- Go to WPML-> Settings-> Custom Fields Translation section
2- Click "Show System Fields"
3- Search for the "_bricks_template_settings" field
4- Set as Copy Once and save
5- Edit the template in the default language
6- Make a minor edit and update it
6- Switch the language using the top admin bar
7- Edit the translated template using Bricks
8- Edit the translated template display conditions
9- Select the translated term and save it
I tried the above steps on the Asia template, which fixed the issue in this language. Please try the steps from Step 7 in other languages and let me know if that fixes the issue.