ffs
Junior Member
France-based member
Posts: 307
inherit
264704
0
Jun 12, 2022 11:13:10 GMT -8
ffs
France-based member
307
July 2021
frenchforumsurvivor
|
Post by ffs on Jul 22, 2021 8:56:36 GMT -8
The forum is only young, less than two weeks old, set up in a rush, and I'm discovering things all the time, thanks to Kami for what she's helped me with already.
As you can see, the navbar is a little crowded, with 11 items. Counting from the left, I would like to be able to reposition items 2, 3, and 11 in the top right corner.
I searched the Plugin library for something that might do the trick, but didn't find anything, so I imagine it's a question of changing the code somewhere and possibly adding a <span> around the relevant links - grateful for any help or suggestions.
|
|
#e61919
Support Staff
224482
0
Member is Online
1
Nov 22, 2024 10:59:33 GMT -8
Scott
“Asking for help isn't giving up... it's refusing to give up.”
24,512
August 2015
socalso
|
Post by Scott on Jul 22, 2021 10:37:53 GMT -8
ffs, rather than refer to the nav items by number, can you specify by name which items you would like moved to the banner area. This be of help to the member that offers assistance, and avoid any confusion. Also do you want the items to just be a linked word or resemble a button? Do you want another navigation-type bar at the very top of the page?
|
|
ffs
Junior Member
France-based member
Posts: 307
inherit
264704
0
Jun 12, 2022 11:13:10 GMT -8
ffs
France-based member
307
July 2021
frenchforumsurvivor
|
Post by ffs on Jul 22, 2021 10:53:00 GMT -8
ffs , rather than refer to the nav items by number, can you specify by name which items you would like moved to the banner area. This be of help to the member that offers assistance, and avoid any confusion. Also do you want the items to just be a linked word or resemble a button? Do you want another navigation-type bar at the very top of the page? Ideally I'd want Help, Search, and Contact us at the top right and the rest bottom left, as in the mock-up below, and yes, a shorter navbar at the top, with the links still being the same as before.
|
|
ffs
Junior Member
France-based member
Posts: 307
inherit
264704
0
Jun 12, 2022 11:13:10 GMT -8
ffs
France-based member
307
July 2021
frenchforumsurvivor
|
Post by ffs on Jul 22, 2021 10:54:04 GMT -8
And thanks for moving the topic to an appropriate section as well.
|
|
ffs
Junior Member
France-based member
Posts: 307
inherit
264704
0
Jun 12, 2022 11:13:10 GMT -8
ffs
France-based member
307
July 2021
frenchforumsurvivor
|
Post by ffs on Jul 22, 2021 10:55:52 GMT -8
PS Since doing the mock-up I've hidden the Forum menu item, as it's just the same as Home.
|
|
ffs
Junior Member
France-based member
Posts: 307
inherit
264704
0
Jun 12, 2022 11:13:10 GMT -8
ffs
France-based member
307
July 2021
frenchforumsurvivor
|
Post by ffs on Jul 23, 2021 2:54:41 GMT -8
Another admin has re-institued the Guests must login option, I can turn it off again if that's going to pose a problem.
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,017
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Jul 23, 2021 5:55:36 GMT -8
Another admin has re-institued the Guests must login option, I can turn it off again if that's going to pose a problem. Here's a quick script to perform this on page load instead of a template modification: <script> /* RELOCATE SELECT NAVIGATION MENU ITEMS TO TOP RIGHT OF HEADER (Install: Global Footer) */ (_=>{ let new_menu_items = new Array(_.length) $('#navigation-menu').find('a') .each((i,e)=>{ $.each(_, (j,f)=>{ let $e=$(e), text = $e.text().replace(/[\t\n]+/g,'').toLowerCase(); if($e.has('.tip-number')){text = text.replace(new RegExp($('.tip-number').text()+'$'),'')} if(text === (""+f).toLowerCase()){ new_menu_items[j]= $(e).parent(); } }) }) if((new_menu_items=new_menu_items.filter(()=>!0)).length){ /** NOTES: Depends on header having the default position:relative applied to become the adoptive parent and #navigation-menu NOT having position:relative applied to lose custody **/ let new_menu = $('<ul></ul>',{style:'position:absolute;margin:0;right:0;top:8px'}) .appendTo($('#navigation-menu')) /* for jquery versions < 8 */ new_menu.append.apply(new_menu,new_menu_items) /* for jquery versions >= 8 */ //new_menu.append(new_menu_items) } }) /* Add text of the menus to relocate in the array below, the order in the array will be the order they appear */ (['profile','members']) </script> Without access to the forum to see the interaction between other possible scripts, plugins and template changes it will obviously be hit-or-miss. The advantage of this script is it will be able to operate across multiple themes and also handle non-standard menus added by other scripts/plugins provided they are operational by the time this script executes. You specify the menus you want relocated via the last line (example left in script shows it setup to move the "profile" and "members" menu to the top right).
|
|
ffs
Junior Member
France-based member
Posts: 307
inherit
264704
0
Jun 12, 2022 11:13:10 GMT -8
ffs
France-based member
307
July 2021
frenchforumsurvivor
|
Post by ffs on Jul 23, 2021 8:05:36 GMT -8
Thanks a lot for that, Chris, it works fine, just what I needed!
|
|
ffs
Junior Member
France-based member
Posts: 307
inherit
264704
0
Jun 12, 2022 11:13:10 GMT -8
ffs
France-based member
307
July 2021
frenchforumsurvivor
|
Post by ffs on Jul 23, 2021 8:33:44 GMT -8
Spoke too soon! It doesn't seem to work with a custom page.
In the last line of the script I have added the following to specify the menu items I wanted moving:
/* Add text of the menus to relocate in the array below, the order in the array will be the order they appear */ (['help','search','page/contact-us']) Contact us is a custom page, and in the Navigation tab of Settings>Forum Settings the URL shown for the Contact us page is shown as /page/contact-us and as help and search didn't have the leading /, I didn't put it before the custom page URL either. Even if I do, or if I just have 'contact-us', it doesn't move the menu item for the page to the top.
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,017
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Jul 23, 2021 8:47:25 GMT -8
If you named it "Contact us" as it appears to be in that mockup image you posted then that is what you would put in the code (case-insensitive). It is looking for the actual text of the menu item and not concerned with the URL to which it might be going
(['help','search','Contact us'])
|
|
ffs
Junior Member
France-based member
Posts: 307
inherit
264704
0
Jun 12, 2022 11:13:10 GMT -8
ffs
France-based member
307
July 2021
frenchforumsurvivor
|
Post by ffs on Jul 23, 2021 8:53:18 GMT -8
If you named it "Contact us" as it appears to be in that mockup image you posted than that is what you would put in the code (case-insensitive). It is looking for the actual text of the menu item and not concerned with the url to which it might be going (['help','search','Contact us']) As they say somewhere, you da Man! Brilliant, Chris, worked a treat.
|
|
ffs
Junior Member
France-based member
Posts: 307
inherit
264704
0
Jun 12, 2022 11:13:10 GMT -8
ffs
France-based member
307
July 2021
frenchforumsurvivor
|
Post by ffs on Jul 23, 2021 11:14:44 GMT -8
Have come up against a visibility problem with the custom page in the re-positioned menu. This is the view Staff have of the header:
And this is the view ordinary members have:
And guests' view:
Bearing in mind that the Contact us page was created with a view to allowing those having login problems or similar to contact Staff, it is not the ideal outcome if they can't even see the Contact us option.
In fact, even if I move the Contact us menu back to its original position, which I have done, only Staff can see it, despite the fact that Permissions are set to Everyone.
Confused, here.
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,017
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Jul 24, 2021 3:29:21 GMT -8
The visibility of a menu item, as you described, is a function of the forum software, a code would not be able to handle that for you. You may want to post your issue in the support board where admins (red names) have the ability to enter and view all aspects of your forum and can assist you much better than a guest like me who can't even see the menu in question.
|
|
ffs
Junior Member
France-based member
Posts: 307
inherit
264704
0
Jun 12, 2022 11:13:10 GMT -8
ffs
France-based member
307
July 2021
frenchforumsurvivor
|
Post by ffs on Jul 24, 2021 7:51:47 GMT -8
Thanks, Chris, I'll do that.
|
|