Our implementation looks very similar to Mark's. We created 2 additional components in the
app/info directory of our theme, one for an About component and one for a Guidelines component. I started by just copying one of the existing "feedback" or "privacy" directories (I forget which one I used, but either will work) then changed the filename names, content, selectors etc. I modified
lazy-theme.module.ts in my theme folder to import my 2 new components. This seems to mimic what Mark did according to that diff in Slack.
Where Mark and I differ is how I added those 2 components to DSpace. We wanted an About menu at the start of the nav bar with a dropdown for our About and Guidelines pages, and wanted the URLs to be like the Feedback URL (/info/feedback) i.e. /info/about and /info/guidelines. To do this I modified the core /src/app/info/info-routing.module.ts and imported my 2 components there and added this right below the existing FEEDBACK_PATH path (around line 20)
{
path: 'about',
component: AboutComponent,
resolve: { breadcrumb: I18nBreadcrumbResolver },
data: { title: 'info.about.title', breadcrumbKey: 'info.about' },
},
{
path: 'guidelines',
component: GuidelinesComponent,
resolve: { breadcrumb: I18nBreadcrumbResolver },
data: { title: 'info.guidelines.title', breadcrumbKey: 'info.guidelines' },
}
To add my About menu and the dropdown options (this may not be needed for 7.6 as I think there have been some additional themable components added related to the nav bar; I did this in 7.4 initially) I added this section to /src/app/menu.resolver.ts at about line 96 (i.e I inserted these as the very first entries in the menuList array in createPublicMenu, right before the existing Communities and Collections element)
/* About */
{
id: `about_about`,
parentID: 'about',
active: false,
visible: true,
model: {
type: MenuItemType.LINK,
text: `info.about.title`,
link: `/info/about`
} as LinkMenuItemModel
},
{
id: `about_guidelines`,
parentID: 'about',
active: false,
visible: true,
model: {
type: MenuItemType.LINK,
text: `info.guidelines.title`,
link: `/info/guidelines`
} as LinkMenuItemModel
},
{
id: 'about',
active: false,
visible: true,
index: 0,
model: {
type: MenuItemType.TEXT,
text: 'menu.section.about'
} as TextMenuItemModel,
},
I don't like having to modify code outside of the theme, but I was in a bit of a rush to get this working. I think 7.6 made some additional nav related stuff themable so I might be able to undo that last modification. I haven't actually investigated that yet.
- Darryl