This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Tagged: 

Setting custom homepage layouts using WPML and Jump Start v2

  • Creator
    Topic
  • #24298
    srumery
    Participant

    We’re using the Theme Blvd WPML Bridge with Jump Start v2 and can’t see where we set the homepage for each language. In Jump Start v1, the homepage layout was done in theme options while Jump Start v2 removed that setting and is now using the “Settings | Reading” setup. In this area, I don’t see a way to set it for multiple languages. I also check the theme options for each language (we’re using two) and can’t find it.

    These are the instructions for how to do it with Jump Start v1:
    http://wpml.themeblvd.com/documentation/custom-homepage-layouts/

    How can we set a custom homepage for each language using Jump Start v2?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Author
    Replies
  • #24299
    srumery
    Participant

    UPDATE: I created a new page called Homepage and added custom layout content to it for English. Then, I set this page as the static homepage in the reading settings. Next, I added a Spanish translation for this page and published it. This looks like how it should be setup but I can’t seem to save custom layout content to the Spanish version of the page.

    I’m almost there but can’t get it to work.

    #24301
    Jason Bobich
    Keymaster

    Yeah, that’s all you’d do. Just use WPML to create a Spanish version of your page, and on that page, you’re building a separate custom layout.

    This looks like how it should be setup but I can’t seem to save custom layout content to the Spanish version of the page.

    Can you explain this more? What do you mean you can’t get the custom layout to save?

    #24305
    srumery
    Participant

    All pages and posts work as expected regarding multiple languages *except* when “Custom Layout” is selected in the page attributes. As soon as this is selected and saved, any updates made in other languages are not saved. Not only do they not saved, but the content for the Spanish language is displaying the custom layout selected in the English version.

    I noticed one of the Jump Start demos has a language option in the top bar to switch between English and French. However, when French is selected on the homepage, it still displays English content. Is this an error or is the French version just not translated?

    English: http://demoblvd.com/themes/jumpstart-2/demo-1/
    French: http://demoblvd.com/themes/jumpstart-2/demo-1/?lang=fr

    I can open up the site for you if you need it. If you need access, let me know how to send them to you securely.

    Thank you, Jason.

    #24309
    Jason Bobich
    Keymaster

    I think I’ve found what the issue is. Let’s try this. In the root directory of your Jump Start theme, open wpml-config.php and find this:

    <custom-field action="copy">_tb_custom_layout</custom-field>
    <custom-field action="copy">_tb_builder_elements</custom-field>

    And change it to this:

    <custom-field action="translate">_tb_custom_layout</custom-field>
    <custom-field action="translate">_tb_builder_elements</custom-field>

    On my end, I had some issues with WPML actually implementing this change after I made it in wpml-config.php … I’m not sure if it’s a caching issue with the XML file and how WPML handles it or if you’ll even have the same issue. But the way I ended up getting around that was:

    I coped wpml-config.php to my child theme. Then, deleted it within the parent theme. It appeared this made it so WPML was forced to update what is sees in the file. After this, I went ahead and put everything back — wpml-config.php back to the parent theme, and deleted from my child theme, and everything continued to work.

    #24315
    srumery
    Participant

    I gave it a shot but I am still seeing the same behavior so I don’t know if WPML is using the new file yet. I tried the workaround you noted as well as putting the file in both the parent and child themes and just having it in one at a time but no luck yet. I’ll see if I can update a few settings in WPML and see if that shakes it up so it looks at the config file.

    Here are a couple screenshots that might help. They show the custom fields for WPML before a new page saved and after it is saved. The _tb_builder_sections field is set to “Translate” but the _tb_builder_elements field is set to “Copy” and it’s grayed out so I can’t even change it through the UI.

    Before publishing: http://screencast.com/t/sLmYN0JU
    After publishing: http://screencast.com/t/XWEj6fFYGBK

    • This reply was modified 7 years, 1 month ago by srumery. Reason: formatting
    #24318
    Jason Bobich
    Keymaster

    It is probably worth noting that the UI screen you’re looking at is from one of their addon plugins and not default WPML.

    Outside of that, the XML file is the only place this is designated. It seems the issue is getting WPML to recognize the change. Can you contact their support? I have no idea.

    You need to make it so WPML doesn’t have it set to “copy” for those builder related custom fields. I would make it simple for them and have just the XML file in the parent theme set the way we’ve talked about, and ask why is it still forcing the “copy” setting?

    #24328
    srumery
    Participant

    Your workaround eventually fixed the issue. I think I just had to edit the WPML options and re-save the settings. After that, everything was performing as expected.

    Jason, thank you very much for working through this with me.

    #24345
    Jason Bobich
    Keymaster

    I have an untested theory for this after looking through the code of the WPML plugin that handles all this — It appears that WPML goes through a process where it parses the XML file, and then saves that information to the database. However, it only goes through this process on certain pages of the WP admin — manage plugins page, manage themes page, and some of the WPML admin pages.

    I think what this means if you were to change the XML file in the theme, then go directly to the Edit Page screen of your WP admin (for example), there’s no change because WPML is working off what was previously parsed from the XML file and saved to the database. So, if this theory is correct, after changing the XML file, you could (for example) go to the Themes or Plugins page of your WP admin to spark the update.

    #24349
    srumery
    Participant

    I bet you’re right. The site is running as expected now. Thank you for your continued support.

    #24427
    Erik Almén
    Participant

    XLNT. Had the exact same issue. Works fine now.

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.