How do I add another option to the main menu in DSpace 9.1?

38 views
Skip to first unread message

Aroldo Rique Júnior

unread,
Nov 14, 2025, 1:13:12 PMNov 14
to DSpace Technical Support, paulo...@mpf.mp.br
I'd like to add another option to our Main Menu (Tutorial), just like in our DSpace 8, as shown in the image below.
image.png

In DSpace 8, adding another option to this menu was very simple. You just had to modify the `createPublicMenu$()` function in the `menu-resolver.service.ts` file:

menuList.push(
            /* Tutorial */
            {
              id: 'browse_global_tutorial',
              active: false,
              visible: true,
              index: 3,
              model: {
                type: MenuItemType.ONCLICK,
                text: 'Tutorial',
                function: () => {
                  window.open("http://hdl.handle.net/11549/318600", "_blank");;
                },
              } as OnClickMenuItemModel,
            },
          );
        }


However, in DSpace 9.1, this `menu-resolver.service.ts` file no longer exists, so I can't find which file to modify to add another option to the main menu. Has anyone here done this before?

Aroldo

Aroldo Rique Júnior

unread,
Nov 14, 2025, 1:52:28 PMNov 14
to DSpace Technical Support, paulo...@mpf.mp.br
I found this email from Tim explaining how to add a static menu to the main menu. I did what he suggested, but it didn't work; the new menu didn't appear.

image.png

My navbar.component.html:

<nav [ngClass]="{'open': (menuCollapsed | async) !== true}"
  [@slideMobileNav]="(isMobile$ | async) !== true ? 'default' : ((menuCollapsed | async) ? 'collapsed' : 'expanded')"
  class="navbar navbar-light navbar-expand-md px-md-0 navbar-container" role="navigation"
  [attr.aria-label]="'nav.main.description' | translate" id="main-navbar">
  <!-- TODO remove navbar-container class when https://github.com/twbs/bootstrap/issues/24726 is fixed -->
  <div class="navbar-inner-container w-100" [class.container]="(isMobile$ | async) !== true">
    <div class="w-100">
      <div id="collapsingNav">
        @if ((isMobile$ | async) && (isAuthenticated$ | async)) {
          <ds-user-menu [inExpandableNavbar]="true"></ds-user-menu>
        }
        <div class="navbar-nav align-items-md-center me-auto shadow-none gapx-3" role="menubar">
          @for (section of (sections | async); track section) {
            <ng-container
            *ngComponentOutlet="(sectionMap$ | async).get(section.id)?.component; injector: (sectionMap$ | async).get(section.id)?.injector;"></ng-container>
          }
           <!-- EXAMPLE CUSTOM HEADER LINK -->
          <a role="menuitem" href="https://dspace.org" class="ds-menu-item">Link to DSpace.org</a>
        </div>
      </div>
    </div>
  </div>
</nav>

Aroldo

Michael Plate

unread,
Nov 18, 2025, 11:59:47 AM (11 days ago) Nov 18
to dspac...@googlegroups.com
Hi Aroldo,

Am 14.11.25 um 19:52 schrieb Aroldo Rique Júnior:
> I found this email from Tim explaining how to add a static menu to the
> main menu. I did what he suggested, but it didn't work; the new menu
> didn't appear.
>
[…]

AFAIK the change is done after 8.0, because we use 8.0 and the old
structure is inside.

However, I used Tim's solution in a plain 9.1, and it works.
Nothing we want, we want to have menus wich links to components inside
DSpace, and some submenus. Seems to be some work…

Michael

DSpace Technical Support

unread,
Nov 18, 2025, 12:23:33 PM (11 days ago) Nov 18
to DSpace Technical Support
Hi Aroldo,

I just tried it myself and it still works, but the <div> structure is slightly different in the latest version of DSpace.  So, I've updated the instructions in the Documentation at https://wiki.lyrasis.org/display/DSDOC9x/User+Interface+Customization#UserInterfaceCustomization-CustomizeNavigationLinksinHeader

That structure works for me locally.

Tim

Aroldo Rique Júnior

unread,
Nov 18, 2025, 2:42:45 PM (11 days ago) Nov 18
to DSpace Technical Support
It worked, Tim! Thank you!

Now, I've changed the navbar.component in the dspace theme. That was the problem.

--
All messages to this mailing list should adhere to the Code of Conduct: https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
---
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dspace-tech/ce3e21ea-97df-44d9-8397-7c3c3ff26ebfn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages