-
AuthorPosts
-
July 8, 2024 at 3:42 pm #1461614
This Translatepress shortcode (https://translatepress.com/docs/restrict-by-language/translation-shortcode/) does not work in the Advanced Layout Editor (the [/trp_language] bit just shows up as normal text on the page). Which is very unfortunate, because I build this whole website for a client with this editor, and we don’t want to start anew with another editor if at all possible. But I need to be able to have language-specific content. I’ve been in contact with Translatepress and the shortcode seems to work fine in any other editor.
Is this something you are working on or are planning to work on in the future? We would love to keep working with the Advanced Layout Editor, but that’s not possible if this shortcode will never work.
Hope to hear from you – thanks!
July 9, 2024 at 5:41 am #1461648Hey MartinOptLand,
Thank you for the inquiry.
Where are you using the shortcode? It should work in a Text or Code Block element, but you can only use the shortcode for content inside those elements. You cannot use it to control the visibility of other elements.
Best regards,
IsmaelJuly 9, 2024 at 3:42 pm #1461703Hi Ismael, thank you for your reply!
Yes, I’ve tried both elements. In the Code Block element it does not work at all,
[/trp_language]
just appears as normal text. The only way it works in a Text element, is that it can hide/display the text in between the code within that same element and nothing else.But that is not the purpose of the shortcode. As you can see in the link I shared in my previous message, in the Gutenberg Editor (and Elementor as well, for that matter) you can hide/display any kind of block/element with this shortcode. We need it to hide videos and other elements from the Advanced Layout Editor – not just text.
Why doesn’t this shortcode work in the Advanced Layout Editor the same way it does in the Gutenberg Editor or Elementor, and the way Translatepress says it should?
(Also, I’ve created a staging environment and I’ve tried deactivating all the plugins. It changes nothing.)
July 10, 2024 at 7:04 am #1461741Hi,
Thank you for the update.
Are you adding the opening tag and the closing tag of the shortcode in separate Text or Code Block elements and expecting to control the visibility of the element between these blocks? Unfortunately, this is not going to work. As mentioned before, you can only use the shortcode as a whole within a single code or text block element.
This should work:
[trp_language language="en_US"] English content only [/trp_language]
However, this is probably what you’re trying to do:
Text Block: [trp_language language="en_US"] ===== Elements in between ===== Text Block: [/trp_language]
The setup above is not going to work because the theme won’t be able to parse or recognize the separated shortcode, so it renders it as ordinary text. Please contact the plugin developers for more info.
Best regards,
IsmaelJuly 10, 2024 at 10:46 am #1461763Hi Ismael,
I understand what you’re saying. It’s just very unfortunate that something that works just fine in other editors (to hide/display whole elements in certain languages), doesn’t work in your theme’s Advanced Layout Builder. Translatepress can’t do anything about that, as I said, I’ve already been in contact with them. It’s specific to Enfold.
So thank you for your explanations. It’s clear to me now that I’ll have to rebuild this website with another editor.
Best regards!
July 12, 2024 at 6:13 am #1461889Hi,
Sorry to hear about that. Unfortunately, implementing a dedicated option for this shortcode or toggle will require a significant amount of modification, which is beyond the scope of our support. If it is crucial for you to have this functionality implemented, you have the option to hire a freelancer who can assist you with the customization. You can find freelancers who specialize in theme customization by visiting our customization page.
If you have any other questions or require further assistance, please feel free to let us know.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.