Welcome to TalkGraphics.com
Results 1 to 10 of 38

Hybrid View

  1. #1
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,952

    Info Re: Woods and Trees !

    Quote Originally Posted by zapatak View Post
    Hi, and thanks for your rapid responses.
    As far as making multiple version sites is concerned, I have been there. I have done trilingual holiday letting sites and local museum work. Quick and easy to set up but six months later when the memory cells have been disolved in red wine and you are asked to update and modify they can be a real knicker twister !
    I liked Acorn's solution and that is very much like something which I tried and had in mind. Problems are that the initial page has no text until a button is pressed. Everytime you link to another page you have once again to make the language choice.
    These issues could be solved if one could set the status of layers 'visible' or 'not visible' in advance. I could be wrong but it appears to me that by default all new layers are off until turned on.
    It would be really good if the status of a layer could be optionally transferred to the web page it linked to. Meaning if French was turned on in the index page it would remain on until actively changed.
    Maybe this is already possible ? Happen I am asking too much ? Looking forward to hearing your views and suggestions.
    Stay safe !
    zapatak, I expected the ask for having a pop-up open on page load. I did a simple Page Head Code for this a time back:
    Code:
    <script>
      setTimeout( function(){
        xr_v1(document.getElementById('english').parentNode.parentNode.parentNode);
      }, 1000);
    </script>
    This delays the English Layer opening to an Anchor on the layer Named "english".

    Xara already adds <html lang="en"> to the HTML when you use Text tool > Spelling icon > Document language: English (U.K.)

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  2. #2
    Join Date
    Jun 2019
    Location
    Provence, France
    Posts
    57

    Default Re: Woods and Trees !

    Hi Acorn,
    Thanks for your reply but unfortunately I don't understand how to use it !
    I have added your script to the header page properties of the index page but what else do I need to do ?
    I have no experience of anchoring and am feeling a little out of my depth ! I managed to stick an anchor icon to a bit of text but it didn't help...
    As is apparant I am pretty clueless in this department but is there some sort of repositry where variables are stored whilst a page is displayed and would it be possible to copy the layer id from this to use in the next page ?
    just musing,
    Thanks again

  3. #3
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,952

    Info Re: Woods and Trees !

    zapatak, no worries, I was at lunch.

    Xara - Franglais - opens in English.xar

    The code block should sit in Web Properties > Page > HTML Code Insertion > HTML code (head).
    If you want it on every page then Web Properties > Website > HTML Code Insertion > HTML Code (head).
    Change the 1000 to any value. 0 is instant, 5000 is 5 seconds.

    In the English layer, any object should have a Name associated with it. I chose the text area. Selection tool > left-click object + Utilities > Names: english. Note I used lowercase here to avoid layer and Name confusion.
    In the French layer, any object should have a Name associated with it. I chose the text area. Selection tool > left-click object + Utilities > Names: french. Note I used lowercase here to avoid layer and Name confusion.

    The English icon has Web Properties Link as popup: open "English" close "French"
    The French icon has Web Properties Link as popup: open "French" close "English"
    Both should have Repeat on all pages set.

    To put this into production, you probably need to pass a language flag between page links to ensure the called page opens in the same language.

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  4. #4
    Join Date
    Jun 2019
    Location
    Provence, France
    Posts
    57

    Default Re: Woods and Trees !

    Dear Acorn,

    Thanks for the help, I now have the english layer opening by default on every page.

    Sorry that I didn't get back yesterday but a motorist has demolished a telegraph pole about a hundred yards from the house ! No repair planned before monday but we are just about managing to get online with a very chilled 'Hotspot' on my phone.

    Two, at least, things which I don't quite follow.... I have not found a, 'Repeat on all pages' option. in the Web properties Link box.

    How do I pass a 'language flag between page links to ensure that the next page continues in the same language' ?

    Sorry for being so dim !

    Take care

  5. #5
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,952

    Default Re: Woods and Trees !

    zapatak, the 'Repeat on all pages' option is select the two flags then Arrange > Repeating Object > Repeat on all pages.

    How do I pass a 'language flag between page links to ensure that the next page continues in the same language' ? - I need to work that out. It would be a case of including the window.location.search part to any link as "?lang=french" or "?lang=english" with some JavaScript to work with what it finds.

    I have no guarantees this will work and I will report back on my progress.

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  6. #6
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,952

    Info Re: Woods and Trees !

    zapatak, I have a working solution for you.

    It requires explanation:
    • Modern browsers have the capability of sessionStorage. This allows persistence across a website's pages where what is set in one page is "known" across all the others. When you close the browser, the session end as does the persisting term and its value.
      • I set up a term of 'lang' and told it it could be 'french' or 'english'.
      • If you change all references of sessionStorage to localStorage. If you did this even when the browser is closed, the term is kept and remember.

    • I have included a repeating object, a yellow box, with Link -popup: close "French" "English".
      • This has to exist on each page but should be hidden (off-page seems to work).
      • This ensure the pop-up Layers, French and English are properly identified as pop-ups.
      • You may create the layers in different positions in your Page & Layer gallery.
        • Keep them adjacent and consistent across pages.
        • In Preview, hover over the box (which is why I set my file up so the yellow box is on the page) and look at the browser Status Line.
        • I see - javascript:xr_ppc(%27xr_xp4%27);xr_ppc(%27xr_xp5%27); - this tells me the French layer is number 4 (counting up from zero) & the English layer is number 5. xr_ppc means close.

    • The country flag buttons need to use this approach so the sessionStorage term can be set.
      • Union Jack - javascript: xr_ppo("xr_xp5"); xr_ppc("xr_xp4"); sessionStorage.setItem('lang', 'english'); - xr_ppo means open so we have open 5 (English), close 4 (French) and set lang to english.
      • French Tricolor - javascript: xr_ppo("xr_xp4"); xr_ppc("xr_xp5"); sessionStorage.setItem('lang', 'french'); - we have open 4 (French), close 5 (English) and set lang to french.

    • Checking lang across pages. You have most of the detail explained so the code in Website > HTML Body (code) is simply discovering the lang value and opening and closing layers to suit:
    • Code:
      <script>  setTimeout( function(){
          var lang = sessionStorage.getItem('lang');
          if (!lang) { lang = sessionStorage.setItem('lang', 'english'); xr_ppo('xr_xp5');}
          if (lang == 'english') {
              xr_ppo('xr_xp5');
              xr_ppc('xr_pc4');
          }
          if (lang == 'french') {
              xr_ppo('xr_xp4');
              xr_ppc('xr_pc5');
          }
        }, 200);
      </script>
      It needs a tidy but it works.

    Xara - Franglais - opens in English with Persistence.xar

    No Anchors are needed in this solution.

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  7. #7
    Join Date
    Jun 2019
    Location
    Provence, France
    Posts
    57

    Default Re: Woods and Trees !

    Hi Acorn,

    Thanks for your detailed solution, I will have a crack at it later today.

    Unfortunately our internet situation is going from bad to worse, absolutely no 'Hotspot' available yesterday and the telegraph pole repair reprogrammed to the 30th !

    Will keep you posted...

    many thanks for all your help

 

 

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •