All Versions
DSpace Documentation
...
Edit your theme's existing app/navbar/navbar.component.html file. This file defines the entire <nav> which displays the navigation header across the entire DSpace site. While much of the content in this <nav> is loaded dynamically via other Angular components, it is possible to easily add a hardcoded link to the existing header. Find the section of this <nav> which is the <div idrole="collapsingNavmenubar">, as that's where you'll want to add your new link. See inline comments in the example below.
| Code Block | ||
|---|---|---|
| ||
<nav> ... <!-- This DIV is where theThe header links are added dynamically. You should see it surrounding all linksembedded inunder the header if you view HTML source role="menubar" div tag --> <div idrole="collapsingNav" ... > <!-- The links themselves are in an unordered list (UL) --> <ulmenubar" class="navbar-nav" ... > ... <!-- Add your new link at the end (or beginning) of this DIV ULtag in a new LIDIV tag --> <!-- NOTE: All classes used below are the same Bootstrap CSS classes used by our 'dspace' and 'custom' themes. You can modify them if the link doesn't look correct in your theme. --> <li class="nav-item d-flex align-items-center"> 't look correct in your theme. --> <div class="ds-menu-item-wrapper text-md-center"> <a<a role="menuitem" href="http://dspace.org" class="navds-menu-linkitem">DSpace.org</a> </div> </li> </ul> </div> </nav> |
...
Edit your theme's app/footer/footer.component.ts file. Swap the "templateUrl" and "styleUrls" properties, based on which you want to modify in your theme.
| Code Block | ||
|---|---|---|
| ||
@Component({
selector: 'ds-footer',
// If you want to modify styles, then...
// Uncomment the styleUrls which references the "footer.component.scss" file in your theme's directory
// and comment out the one that references the default "src/app/footer/footer.component.scss"
styleUrls: ['footer.component.scss'],
//styleUrls: ['../../../../app/footer/footer.component.scss'],
// If you want to modify HTML, then...
// Uncomment the templateUrl which references the "footer.component.html" file in your theme's directory
// and comment out the one that references the default "src/app/footer/footer.component.html"
templateUrl: 'footer.component.html'
//templateUrl: '../../../../app/footer/footer.component.html'
}) |
footer.component.html or footer.component.scss or both.footer.component.html file will be empty by default. Copy over the default HTML code from src/app/footer/footer.component.html into your version of this file.footer.component.scss file will be empty by default. Copy over the default Sass code from src/app/footer/footer.component.scss into your version of this file.assets/images folder. Then reference them at the /assets/[theme-name]/images/ URL path.DSpace also has a option to display a two-level footer, which is becoming more common these days. By default. DSpace just displays a small, bottom footer. But, you can enable a top footer (above that default footer) by add this line into your theme's footer.component.ts
| Code Block | ||
|---|---|---|
| ||
export class FooterComponent extends BaseComponent {
// This line will enable the top footer in your theme
showTopFooter = true;
} |
This top footer appears in the footer.component.html within a div. Notice the "*ngIf='showTopFooter'@if(showTopFooter)", which only shows that div when that variable is set to "true"
| Code Block | ||
|---|---|---|
| ||
<footer class="text-lg-start"> <!-- This div and everything within it only displays if showTopFooter=true --> <div *ngIf="showTopFooter"@if (showTopFooter) { <div class="top-footer"> ... </div> } <!-- The bottom footer always displays --> <div class="bottom-footer ..."> ... </div> </footer> |
...