Announcement

Collapse
No announcement yet.

Moving the Admin Button From The Footer To the Header Nav Bar

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Moving the Admin Button From The Footer To the Header Nav Bar

    Hello is that possible?

  • #2
    Yes. Use Site Builder to create an identical link in the nav bar with visibility only to administrators.
    Then delete the one in the footer.
    MARK.B | vBULLETIN SUPPORT

    TalkNewsUK - My vBulletin 5.4.0 Demo - FEATURING "ROUTE BY NODE"!
    AdminAmmo - My Cloud Demo

    Comment


    • #3
      Originally posted by Mark.B View Post
      Yes. Use Site Builder to create an identical link in the nav bar with visibility only to administrators.
      Then delete the one in the footer.
      I actually meant the bar way at the top. Not sure what its called. I even have the space when i click on "Edit Site" tab. I just dont like scrolling down for the admin cp. And i also dont like clicking on the edit site button. lol Lazy i guess.

      ​​​​​​

      Comment


      • #4
        There should already be an admincp link in that bar, as long as you have Site Builder on.
        MARK.B | vBULLETIN SUPPORT

        TalkNewsUK - My vBulletin 5.4.0 Demo - FEATURING "ROUTE BY NODE"!
        AdminAmmo - My Cloud Demo

        Comment


        • #5
          Click image for larger version  Name:	snip_20170913151714.png Views:	1 Size:	21.6 KB ID:	4377225



          As Mark said there is already a link there. Just leave "Edit Site" on. While it caused a performance issue in the very early days of vBulletin 5, that has been fixed in later versions.

          If you want to add another link, it would require editing the header template to add it.
          Translations provided by Google.

          Wayne Luke
          The Rabid Badger - a vBulletin Cloud customization and demonstration site.
          vBulletin 5 Documentation - Updated every Friday. Report issues here.
          vBulletin 5 API - Full / Mobile
          Vote for your most annoying bugs.
          I am not currently available for vB Messenger Chats.

          Comment


          • #6
            Originally posted by Wayne Luke View Post
            Click image for larger version Name:	snip_20170913151714.png Views:	1 Size:	21.6 KB ID:	4377225



            As Mark said there is already a link there. Just leave "Edit Site" on. While it caused a performance issue in the very early days of vBulletin 5, that has been fixed in later versions.

            If you want to add another link, it would require editing the header template to add it.
            Thats kind of what i wanted to know. I hate the look of all the tabs when the edit site is on. I almost always use the admin panel. Just be nice to edit the template. Sounds like its a difficult task? Does new code need to be added?

            Comment


            • #7
              I am not aware of the specifics at this time. I haven't looked at the code lately. I just know the header template would have to be modified.

              You can add a link to your navigation bar that says "AdminCP" and points to the URL of "/admincp". Then edit the permissions so only Administrators see it (just check that single usergroup). This is what Mark originally suggested. This would be quick, easy and doesn't require editing any templates.
              Translations provided by Google.

              Wayne Luke
              The Rabid Badger - a vBulletin Cloud customization and demonstration site.
              vBulletin 5 Documentation - Updated every Friday. Report issues here.
              vBulletin 5 API - Full / Mobile
              Vote for your most annoying bugs.
              I am not currently available for vB Messenger Chats.

              Comment


              • #8
                No need to edit the header template and possibly have template merge conflicts during future upgrades. You can add a Javascript that dynamically adds the Admin link to the top bar if the Admin link in the footer exists. The script can be added in multiple ways without editing any templates that are touched during upgrades: template hook, head_include, header ad module, search engine verification, etc. The easiest is to add the code in head_include template. Basically the code will be:

                Code:
                <script>
                (function() {
                     document.addEventListener('DOMContentLoaded', function() {
                        var admincp = document.querySelector('.js-footer-nav-list a[href*="/admincp"]');
                        if (admincp) {
                            var li = document.createElement('li'),
                                topnav = document.querySelector('.js-top-secondary-nav');
                
                            li.appendChild(admincp.cloneNode(true));
                            topnav.insertBefore(li, topnav.firstChild);
                
                        }
                    });
                })();
                </script>
                Last edited by Glenn Vergara; Wed 13th Sep '17, 11:21pm.

                AutoLinker-vB5+vBCloud | Topic Starter Ribbon | Blur Replies for Guests | NavMenu Dropdown-vB5+vBCloud | TimedSticky | Events Module | Moderator List | Drag/Drop Upload

                Comment


                • Wayne Luke
                  Wayne Luke commented
                  Editing a comment
                  This is an option. It isn't one that is covered by technical support. Users would implement this at their own risk.

              • #9
                Looking at the code, there is a template hook in this location. So you can create a custom template and assign it to the header_navright template hook to add this on a Core (download) vBulletin site.

                Your custom code could be as simple as:
                Code:
                <a href="/admincp">AdminCP</a>
                Translations provided by Google.

                Wayne Luke
                The Rabid Badger - a vBulletin Cloud customization and demonstration site.
                vBulletin 5 Documentation - Updated every Friday. Report issues here.
                vBulletin 5 API - Full / Mobile
                Vote for your most annoying bugs.
                I am not currently available for vB Messenger Chats.

                Comment


                • Glenn Vergara
                  Glenn Vergara commented
                  Editing a comment
                  That will be visible to all users including non-admins. You have to have an if-condition there.

                • Wayne Luke
                  Wayne Luke commented
                  Editing a comment
                  Well aware of that. It is after market modifications so it is not something we provide direct support for at this time. The only supported method would be to add the link to the Navigation Bar.

              • #10
                Originally posted by Glenn Vergara View Post
                No need to edit the header template and possibly have template merge conflicts during future upgrades. You can add a Javascript that dynamically adds the Admin link to the top bar if the Admin link in the footer exists. The script can be added in multiple ways without editing any templates that are touched during upgrades: template hook, head_include, header ad module, search engine verification, etc. The easiest is to add the code in head_include template. Basically the code will be:

                Code:
                <script>
                (function() {
                document.addEventListener('DOMContentLoaded', function() {
                var admincp = document.querySelector('.js-footer-nav-list a[href*="/admincp"]');
                if (admincp) {
                var li = document.createElement('li'),
                topnav = document.querySelector('.js-top-secondary-nav');
                
                li.appendChild(admincp.cloneNode(true));
                topnav.insertBefore(li, topnav.firstChild);
                
                }
                });
                })();
                </script>
                As usual it worked flawlessly. Exactly what i wanted. Now make it an Icon like you did "Notifications" and "Messages" lol. That would be epic.

                Thanks again man. Ill buy you a cup of coffee when we finish that other task.

                Comment

                Working...
                X