Welcome to TalkGraphics.com
Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Jan 2017
    Posts
    19

    Question Is there a way to set (or force) Nav Bar's MouseOver for a menu on each page?

    I have a Nav Bar consisting of 5 items, same as the number of pages I have in my project.

    Below you see an image of a sample where I currently have selected the Articles-page. Note how the Articles nav bar item automatically selects the MouseOver-image and thus it is easy to see that the page is currently selected.
    Click image for larger version. 

Name:	2022-07-07_15-49-37.png 
Views:	43 
Size:	38.9 KB 
ID:	132361

    This probably works this way, because every nav bar menu item links to the defined "Page: xxxx", like this:
    Click image for larger version. 

Name:	2022-07-07_15-52-56.png 
Views:	37 
Size:	37.1 KB 
ID:	132362

    I experiment with XT-CMS (https://xt-cms.com) template framework, which uses the Xara pages in a different way. In order to let my web site support friendly URLs like https://blablabla.com/articles, I need to use similar link-logic in my nav bars.
    Each nav bar item simply links to "/products", "/services" "/about" etc. like this;
    Click image for larger version. 

Name:	2022-07-07_15-59-41.png 
Views:	43 
Size:	31.4 KB 
ID:	132363

    In the latter case, my nav bars do work when I select an item, meaning that the highlighted, MouseOver-image is highlighed when I hover over the menu items. The menu also works, selected the correct page in XT-CMS. However, the nav bar menu does not keep the currently selected page's nav bar item highlighed. Below you see that "all lights are off", after a page has been selected:
    Click image for larger version. 

Name:	2022-07-07_16-03-41.png 
Views:	40 
Size:	43.8 KB 
ID:	132364

    Is there a way, for example via some javascript in the Web Page HTML Head, to set that a certain page should also highlight a nav bar item?

  2. #2
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,814

    Default Re: Is there a way to set (or force) Nav Bar's MouseOver for a menu on each page?

    bobvoi

    The page-aware capability Xara produces usually require a link of form, Link to: (page) ... .

    From what I can see, you are trying elsewhere to present a link as ..blablabla/Articles and not ..blablabla/Articles.htm.
    You cannot do this readily in Xara and copied links will also fail.

    Removing the file extension is a thing done on the server by changing the .htaccess file: https://www.talkgraphics.com/showthr...910#post514910 might help.
    Then you can go back to your original (page) links.

    The final trick is just to add the highlight blob directly onto the MouseOff layer, positioned for the given page.

    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

  3. #3
    Join Date
    Jan 2017
    Posts
    19

    Default Re: Is there a way to set (or force) Nav Bar's MouseOver for a menu on each page?

    Acorn,

    Thanks for a very prompt reply! Unfortunately the .htaccess-way of doing stuff, is not working on my NGINX-setup. I have however be able to replicate the "friendly URL"-replacement in nginx.conf, and could perhaps refine it a little more.

    I guess I will try out your final trick too.

  4. #4
    Join Date
    Apr 2018
    Location
    Barnes, London
    Posts
    952

    Default Re: Is there a way to set (or force) Nav Bar's MouseOver for a menu on each page?

    The final trick is just to add the highlight blob directly onto the MouseOff layer, positioned for the given page.
    Not sure exactly what the OP had in mind, could you use a MouseDown layer to highlight the current page? e.g. https://initiostar.co.uk/demo/traffic-light-menu/
    Gary
    www.initiostar.co.uk


    Xara Designer Pro+ and Xara Designer Pro X 19.0.1.65946 DL x64 Feb 7 2023

  5. #5
    Join Date
    Jan 2017
    Posts
    19

    Default Re: Is there a way to set (or force) Nav Bar's MouseOver for a menu on each page?

    Initiostar, thanks for chiming in!

    I have also thought that the MouseDown-layer perhaps could play a role where. I haven't found many examples using the MouseDown-layer properly, and while the User's Guide do mention it here, it seems like it isn't much in use (anymore).

    What I don't quite grasp yet, is how I activate the MouseDown-layer from page to page. In your Traffic Light example, the Home-button does indeed show the MouseDown-variant. If I click on the Product-button, the MouseOver-image do light up when I hover, but I can't change it to MouseDown. The question is therefore, how do I "tell" the Product-page that it should now have the MouseDown-image of the Product-button?

    I understand that this perhaps is more like a show-and-tell page, and not a fully working example.

  6. #6
    Join Date
    Apr 2018
    Location
    Barnes, London
    Posts
    952

    Default Re: Is there a way to set (or force) Nav Bar's MouseOver for a menu on each page?

    Quote Originally Posted by bobvoi View Post
    Initiostar, thanks for chiming in!

    I have also thought that the MouseDown-layer perhaps could play a role where. I haven't found many examples using the MouseDown-layer properly, and while the User's Guide do mention it here, it seems like it isn't much in use (anymore).

    What I don't quite grasp yet, is how I activate the MouseDown-layer from page to page. In your Traffic Light example, the Home-button does indeed show the MouseDown-variant. If I click on the Product-button, the MouseOver-image do light up when I hover, but I can't change it to MouseDown. The question is therefore, how do I "tell" the Product-page that it should now have the MouseDown-image of the Product-button?

    I understand that this perhaps is more like a show-and-tell page, and not a fully working example.
    Here is an updated working example: https://initiostar.co.uk/demo/traffi...menu/index.htm.

    Demo file: Traffic Light Menu.xar

    The principle can apply to any links, not just a NavBar.
    Gary
    www.initiostar.co.uk


    Xara Designer Pro+ and Xara Designer Pro X 19.0.1.65946 DL x64 Feb 7 2023

  7. #7
    Join Date
    Jan 2017
    Posts
    19

    Default Re: Is there a way to set (or force) Nav Bar's MouseOver for a menu on each page?

    Hello again Initiostar and thanks for the sample.

    Now I see how the MouseDown layer works - together with the Navbar which is "distributed" to MouseOver and MouseDown.

    Looking at your example, I also see that every page "knows which page is active", meaning that if I for example select the About-page, the MouseDown-image for About is also active. The mechanism behind this, seems to be tied to the fact that the pages are linked like this:
    Click image for larger version. 

Name:	2022-07-08_10-06-09.png 
Views:	38 
Size:	29.1 KB 
ID:	132366

    If I choose to link the pages in other ways, such as shown below, the "highlight current page"-feature won't work anymore. Below you see a direct link to the same page (note that the "Correct automatically" is turned off to make the "./pagename.htm" work:
    Click image for larger version. 

Name:	2022-07-08_09-59-22.png 
Views:	34 
Size:	28.5 KB 
ID:	132367

    After I have changed all the links, the Nav Bar content now look like this:
    Click image for larger version. 

Name:	2022-07-08_09-58-45.png 
Views:	36 
Size:	34.5 KB 
ID:	132368

    If you then preview all the pages now, you will see that all the navbar-links do switch the pages correctly, but the navbar no longer knows which page is active.

    I guess this means that the navbar-internals somehow "know" which page is active in the former example, because of the link-type to a page name in the navbar.
    This is where it would have been supercool if we could set some kind of variable in the page-header, to tell the navbar-internals which page are active. This means that for example the About-page, could have some Javascript added the the Web Page's HTML Head area, where for example the variable "xr_pagename=about" would mean that the About-button is highlighted. Or, some javascript in a placeholder at the very end, which could call some navbar function to select a specific navbar.

    I have included a modification of your xar file with the direct links too:
    Traffic Light Menu - with direct links instead.xar

  8. #8
    Join Date
    Apr 2018
    Location
    Barnes, London
    Posts
    952

    Default Re: Is there a way to set (or force) Nav Bar's MouseOver for a menu on each page?

    You could revert to Acorn's suggestion and use a blob on each active page Traffic Light Menu - with direct links instead.xar ?
    Gary
    www.initiostar.co.uk


    Xara Designer Pro+ and Xara Designer Pro X 19.0.1.65946 DL x64 Feb 7 2023

  9. #9
    Join Date
    Jan 2017
    Posts
    19

    Default Re: Is there a way to set (or force) Nav Bar's MouseOver for a menu on each page?

    Yes, it seems to be the easiest way. When you say blob, I was a little uncertain that I did it correctly.

    If I tried to "overlay" the navbar with a highlighted image in a top-most layer, the navbar quickly gained control and put itself at top.

    My current understanding is therefore that I had to ungroup the navbar-widget and replace the image each page's MouseOff-image with a highlighted image. It seemed to work, albeit the navbar-widget wasn't in play anymore.

    Anyway, thanks a lot for helping me out. I am in the midst of reworking my images to have a MouseDown-layer too now.

    Bob

  10. #10
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,814

    Default Re: Is there a way to set (or force) Nav Bar's MouseOver for a menu on each page?

    Bob, don't do that. If you've a sticky NavBar, make the blob sticky too.

    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

 

 

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
  •