Flip Switch in Master Page to change languages across whole site

All WYSIWYG Web Builder support issues that are not covered in the forums below.
Forum rules
IMPORTANT NOTE!!

DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.



PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
Post Reply
SCurtisCBKA
 
 
Posts: 8
Joined: Mon Jun 05, 2023 10:36 pm

Flip Switch in Master Page to change languages across whole site

Post by SCurtisCBKA »

Hello all,

I am wondering if it is possible to use a Flip Switch element embedded in a Master Page of a site to affect the visibility of text boxes on other pages of the site, to allow for me to display languages in two languages by toggling the visibility of the divs.

Below is a link to my project. Can anyone let me know how to do this? I would use the Language Text extension however the editor for it doesn't offer enough options.

https://file.io/jafac1YfmQNv

Thanks in advance.
User avatar
Pablo
 
Posts: 23249
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Flip Switch in Master Page to change languages across whole site

Post by Pablo »

You can use the flipswitch with conditions to show/how elements.
However, this will only be possible for the element on the current page. In this case, the master page.
SCurtisCBKA
 
 
Posts: 8
Joined: Mon Jun 05, 2023 10:36 pm

Re: Flip Switch in Master Page to change languages across whole site

Post by SCurtisCBKA »

So is there absolutely no way to do it then?
User avatar
Pablo
 
Posts: 23249
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Flip Switch in Master Page to change languages across whole site

Post by Pablo »

It's possible but not if the switch is on a master page, because the switch cannot access elements on another page.
SCurtisCBKA
 
 
Posts: 8
Joined: Mon Jun 05, 2023 10:36 pm

Re: Flip Switch in Master Page to change languages across whole site

Post by SCurtisCBKA »

Would it be possible to toggle it on one page and have the change persist between pages?
SCurtisCBKA
 
 
Posts: 8
Joined: Mon Jun 05, 2023 10:36 pm

Re: Flip Switch in Master Page to change languages across whole site

Post by SCurtisCBKA »

Failing that, if I have to put a button on each page is there any way to make button states persist between pages?
User avatar
crispy68
 
 
Posts: 3001
Joined: Thu Oct 23, 2014 12:43 am
Location: Acworth, GA
Contact:

Re: Flip Switch in Master Page to change languages across whole site

Post by crispy68 »

I tried to download your project to take a look but it's been deleted.

The only way i can think this would work is if you set a toggle state and then use localStorage or sessionStorage to store the value from page to page. Using javascript, each page would check this to determine what the value is and display whatever it is you want.
SCurtisCBKA
 
 
Posts: 8
Joined: Mon Jun 05, 2023 10:36 pm

Re: Flip Switch in Master Page to change languages across whole site

Post by SCurtisCBKA »

Sorry, not sure what happened there. Updated link.

https://zippysha.re/CeJ9c42fz4/2023_07_13_zip
User avatar
crispy68
 
 
Posts: 3001
Joined: Thu Oct 23, 2014 12:43 am
Location: Acworth, GA
Contact:

Re: Flip Switch in Master Page to change languages across whole site

Post by crispy68 »

So, its not too hard to make this work on a single page. I've even used classes to make this work also. The problem is the potential for a lot of text on each and every page. The way I see it, you would need to assign a 'class' to all English text and a different class to all the other language text. Then you are going to need to use javascript to essentially toggle between these classes, hiding one and showing the other and vice versa. Then this info needs to be stored in a session variable so that when you go from page to page it knows what was set. Each page then has to run javascript to read this variable and show the appropriate class. I'm not sure how easy this is going to be. May not be too hard but I'm no javascript guru.
User avatar
wwonderfull
 
 
Posts: 1566
Joined: Fri Aug 21, 2020 8:27 am
Contact:

Re: Flip Switch in Master Page to change languages across whole site

Post by wwonderfull »

@SCurtisCBKA

As @crispy suggested I completely agree with him with the same solution as it would take JavaScript and to set a toggle state and then use localStorage or sessionStorage to store the value from page to page. But that is a messy solution as he mentioned and let me tell you more on how and why.

You see google can translate any text but you are using the same content but just translated meaning it is there but hidden. But not hidden from googles bots or other search engine bots. Although hidden texts are ignored what you are trying to do is to show the MAIN CONTENT of the page with toggle hidden. So it is a kind of duplicate content. If that was possible then a person could have duplicated the same text over and over again whether it is the same language or a text and kept it hidden. But even hidden text can be read because the DOM Element in html but it is just a CSS which is keeping it not visible.

But if you are unlucky you might get a penalty from search engines which there is 90% chances they might not index your page or content just because you tried to manipulate search engines result with same content or keyword stuffing or duplicate content.

A website's webpages can not have duplicate content of any language in different DIV in same page although translated. It is not just a bad way to design but it is also not the proper way to get the solution either. The reasonable and professional way is that If you want then you can use Annotation and create a separate translated page for it and specify it in hreflang. But if you are stuffing the same thing in one page translated and non translated is never the best trick we learned from the web development community. In fact no where this trick as you mentioned is suggested although may be or may not be possible.
Last edited by wwonderfull on Fri Jul 14, 2023 12:20 pm, edited 1 time in total.
User avatar
jerryco
 
 
Posts: 896
Joined: Fri Mar 27, 2009 2:42 pm
Location: Purmerend, Holland

Re: Flip Switch in Master Page to change languages across whole site

Post by jerryco »

So @wwonderfull how bad would it be if @SCurtisCBKA just uses pictures of country flags leading to a folder? Like domain.com/fr?
// Love is the acceptance of nothing / Account age is no guarantee of efficiency ;-) ->

Above, Beyond, and @wwonderfull! <- Genuinely helps you with a powered up site that counts! Four Times Excellence!
User avatar
wwonderfull
 
 
Posts: 1566
Joined: Fri Aug 21, 2020 8:27 am
Contact:

Re: Flip Switch in Master Page to change languages across whole site

Post by wwonderfull »

jerryco wrote: Fri Jul 14, 2023 9:30 am So @wwonderfull how bad would it be if @SCurtisCBKA just uses pictures of country flags leading to a folder? Like domain.com/fr?
That would be possible. But the pages url will have a slight difference and SEO cons too. If the folder has an index page just like the homepage has then the url will change something like this.

For the orignal page suppose english www . example . com
For the other page which is inside the folder for example french language it will become www . example . com /fr/ index . html but not www . example . com /fr/

for it to be www . example . com /fr/ you have to make subpage from the index webpage put it on annotation to specify it as hreflang. Although this may be the one searchengines prefer to be but even this has issues if people dont know the full setup on how it works for the whole website and how it functions. Se before that people should know what they want vs what the search engines want.

But The folder structure allows for language-specific folders within the root domain, separating each language version. This allows for the placement of content and pages within their respective folders, with the root domain serving as the default language. The subpage structure uses language codes as subpages or URL parameters to specify the language version. Both approaches have their advantages, with the folder structure providing clear separation between language versions and the subpage structure keeping URLs concise. Proper hreflang tags in HTML code indicate the language and regional targeting of each page, helping search engines understand language variations and deliver the appropriate version to users based on their preferences. When choosing an approach, it would consider the website's structure, content management system, and SEO requirements.

I talked about it more here too viewtopic.php?p=477769&hilit=hreflang#p477769
SCurtisCBKA
 
 
Posts: 8
Joined: Mon Jun 05, 2023 10:36 pm

Re: Flip Switch in Master Page to change languages across whole site

Post by SCurtisCBKA »

Okay it's a week and a half old now but could I perhaps make the switch simply redirect users to a different subdomain instead and just host another version of the site there?
brynj
 
 
Posts: 184
Joined: Fri May 31, 2013 3:56 pm

Re: Flip Switch in Master Page to change languages across whole site

Post by brynj »

I have two sets of pages, one set in English and the other in German .... a flag icon switches between the two.

Very simple - May not be the most elegant technical solution but it works.
Last edited by brynj on Thu Jul 27, 2023 10:20 am, edited 1 time in total.
User avatar
wwonderfull
 
 
Posts: 1566
Joined: Fri Aug 21, 2020 8:27 am
Contact:

Re: Flip Switch in Master Page to change languages across whole site

Post by wwonderfull »

SCurtisCBKA wrote: Tue Jul 25, 2023 8:49 am Okay it's a week and a half old now but could I perhaps make the switch simply redirect users to a different subdomain instead and just host another version of the site there?
As I already mentioned the professional ways there is another way which you can think about. You could buy a 2nd domain for example for the French language you can buy .fr extensioned domain version

www . example . fr
.fr meaning French in short as domain extension just like amazon.de

and you can upload the French version of the website on that second domain. And then just specify in the Annotation. Remember if the projects are done in 2 separate .wbs projects then the annotation must be done for both .wbs project file's pages.

Put this on head section of the page's HTML. Note that this is just an example

Code: Select all

<link rel="alternate" hreflang="en" href="http://www.example.com/" />
<link rel="alternate" hreflang="fr" href="http://www.example.fr/" />
Note that it can be done manually too using built in options, just go to Page Properties --> SEO --> hreflang

Here is an example I hope you can carry on with some proper decisions.
brynj
 
 
Posts: 184
Joined: Fri May 31, 2013 3:56 pm

Re: Flip Switch in Master Page to change languages across whole site

Post by brynj »

wwonderfull:
Your last solution is fine but does incur additional costs.

Just out of interest - is there a downside to the way I do mine (see previous answer) ? I have a single landing page and the viewer select which language he wishes - this links them to the appropriate home page for that language. I do have to maintain the two sets of pages separately but would have to anyway due to the different languages. On every page is a link which would take them to the other language site if they wanted to do so.

All pages are part of the same project and published as one site.

Not sure what the downsides are ..... i.e. would it be classed as duplicates of every page for search engine purposes and count against the ranking ?
Each page obviously has a unique name but the content is the same just different language.

Thanks
User avatar
wwonderfull
 
 
Posts: 1566
Joined: Fri Aug 21, 2020 8:27 am
Contact:

Re: Flip Switch in Master Page to change languages across whole site

Post by wwonderfull »

brynj wrote: Thu Jul 27, 2023 10:37 am wwonderfull:
Your last solution is fine but does incur additional costs.

Just out of interest - is there a downside to the way I do mine (see previous answer) ? I have a single landing page and the viewer select which language he wishes - this links them to the appropriate home page for that language. I do have to maintain the two sets of pages separately but would have to anyway due to the different languages. On every page is a link which would take them to the other language site if they wanted to do so.

All pages are part of the same project and published as one site.

Not sure what the downsides are ..... i.e. would it be classed as duplicates of every page for search engine purposes and count against the ranking ?
Each page obviously has a unique name but the content is the same just different language.

Thanks
viewtopic.php?p=486892#p486892

On this post I mentioned it on the second solution meaning the subpage one. Having a link to the different language page is not a problem but without putting it on the annotations in hrflang may be the only thing which can cause search engine problems including duplicate content. So the hrflang must be specified. Other than that it's fine.
brynj
 
 
Posts: 184
Joined: Fri May 31, 2013 3:56 pm

Re: Flip Switch in Master Page to change languages across whole site

Post by brynj »

OK thanks
Post Reply