Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
You are using the Twenty Twenty Four theme with a focus on Full Site Editor and are facing issues with adding the WPML language switcher block directly to the default top navigation. Additionally, you are seeking guidance on updating the translated template files for Pages and Front Page.
Solution:
To add the WPML language switcher block directly to the default top navigation, you should first manually edit the navigation block. Once you have manually edited the block, you will see an option in the sidebar to add more blocks. Here, you can select and add a "Navigation Language Switcher" block to your menu.

If this solution does not resolve your issue, or if it seems outdated or not applicable to your specific case, we recommend opening a new support ticket. We also 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. For further assistance, please visit our support forum at WPML Support Forum.

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.

Tagged: 

This topic contains 9 replies, has 2 voices.

Last updated by Dražen Duvnjak 1 month, 2 weeks ago.

Assisted by: Dražen Duvnjak.

Author Posts
September 16, 2024 at 11:07 am #16183229

stefanE-16

Background of the issue:
I am using the theme Twenty Twenty Four with a focus on Full Site Editor. I am trying to add the WPML language switcher block directly to the default top navigation. It looks like that is not working, so I added it below the navigation in a Group block. I also figured out one method to use columns and add a column for the navigation and one column for the WPML language switcher. I am wondering how to update the translated template files for Pages and Front Page. I am thinking about creating a video tutorial of the process.

Symptoms:
The WPML language switcher block is not working when added directly to the default top navigation.

Questions:
How can I add the WPML language switcher block directly to the default top navigation?
How do I update the translated template files for Pages and Front Page?
Do you have additional Full Site Editing (FSE) tutorials?

September 16, 2024 at 11:38 am #16183378

Dražen Duvnjak
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

in the meantime, I have checked on this, and it seems there is not much we can do at this point from the WPML side.

Unfortunately, this is a problem with how the Navigation block works, the list of available blocks at first click that you are showing "Search, Social Icons, Site Logo", the list of displayed blocks here is hardcoded in WP code, so, nothing from a 3rd party can be added currently to that list.

Currently, it's like this, hope this helps and makes sense.

Regards,
Drazen

September 20, 2024 at 1:24 pm #16203183

stefanE-16

I am checking in directly with Make WordPress on Slack and the developers there to see what they say. I am also thinking there should be an Gutenberg issue on this matter.
hidden link

I will let you know what they say.

Thanks!

September 20, 2024 at 1:32 pm #16203230

stefanE-16

Btw I checked in with Poly lang. They have found a work around to add their language switcher to the Navigation area:
hidden link

I found another language plugin which seems to also be finding a way to work around the issue. https://wordpress.org/support/topic/language-switcher-position/

September 20, 2024 at 1:48 pm #16203276

Dražen Duvnjak
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

Thanks for getting back to us and investigating this matter, it is helpful. 🙂

Maybe something changed in the meantime, I will escalate this to our devs as a new feature request and I will update you further on this matter.

Regards,
Drazen

September 21, 2024 at 6:45 pm #16205166

stefanE-16

I would suggest that you go through this Make WordPress Slack thread in the feature-website-navigation area.

hidden link

It mentions WooCommerce and Jetpack.
You may have seen Jetpack and WooCommerce add blocks to the navigation on activation. They use block hooks.

The block developer needs to enable support for the Navigation block.
Here’s an example: hidden link

September 23, 2024 at 6:12 am #16207407

Dražen Duvnjak
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

thanks.

Added it to the escalated tickets.

Regards,
Drazen

September 23, 2024 at 9:47 am #16208445

Dražen Duvnjak
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

it seems this is already possible, sorry I was not aware of this.

The navigation block initially contains a generated list of page links, but once you edit the block to add or move such page links manually then you have the option in the sidebar to add more blocks, from there you can add a "Navigation Language Switcher" block to your menu.

Regards,
Drazen

Screenshot (1).png
September 24, 2024 at 2:36 pm #16215620

stefanE-16

Hi

"it seems this is already possible, sorry I was not aware of this."
---> It is not possible.

It is not possible to drag the Language Switcher into the Navigation area seen in List view. It is not possible to add the block Language Switcher into the Navigation at all from what I have tried out. There might be a way but I have not figured it out.

Btw
Please share this with your developers.
This is feedback from a core contributor whom has worked a lot of the Navigation block.

This is the message I sent Dave.
Heya Dave.

@Dave Smith (getdave/get_dave)

Can a third party such as WPML add a language switcher block to the Navigation?
(I am trying to figure out what to say to support. I mentioned this in the feature-website-navigation channel.)
Thanks.
I hope you are doing well.

His reply:

I don’t see why you can’t add it

We’ve now opened it up

You can filter the block settings and add the block in question to the allowedBlocks property for the settings.

You would also need to manage the wrapping
https://make.wordpress.org/core/2024/03/09/miscellaneous-editor-changes-in-wordpress-6-5/#:~:text=Introducing%20the%C2%A0block_core_navigation_listable_blocks-,filter,-WordPress%206.5%20introduces

Make WordPress CoreMake WordPress Core
Miscellaneous Editor changes in WordPress 6.5

In this dev note, you will find a collection of updates of the Transformer handling, a new slotfill in the site editor, TypeScript updates and the post editor being iframed.
Mar 9th

10:43
Code reference
hidden link

------

Thanks.

Not possible to drag Language switcher into Navigation.jpg
September 25, 2024 at 6:04 am #16218128

Dražen Duvnjak
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

thanks for getting back.

I have already explained that you can not add it the way you are trying, and you need to use a different approach as we have a different block for that, our 2nd dier checked, and confirmed this feature is possible and that is the correct way to add it. You should use that method.

I am also providing a video, if the steps in my last reply were not clear:

- hidden link

Hope this clear things up.

Regards,
Drazen

September 25, 2024 at 1:46 pm #16220838

stefanE-16

For whatever reason it did not work initially but now it seems to be working nicely.

Thank you!