1.1.9 • Published 1 year ago

primo-explore-clickable-logo-to-any-link v1.1.9

Weekly downloads
3
License
MIT
Repository
github
Last release
1 year ago

primo-explore-clickable-logo-to-any-link

CircleCI npm version Coverage Status

Description

The library's logo in the top bar becomes a clickable link to a specified URL.

Installation

  1. Assuming you've installed and are using primo-explore-devenv.

  2. Navigate to your template/central package root directory. For example:

    cd primo-explore/custom/MY_VIEW_ID
  3. If you do not already have a package.json file in this directory, create one:
    npm init -y
  4. Install this package:
    npm install primo-explore-clickable-logo-to-any-link --save-dev

Usage

Once installed, inject clickableLogoToAnyLink as a dependency:

let app = angular.module('viewCustom', ['clickableLogoToAnyLink'])

Note: If you're using the --browserify build option, you will need to first import the module with:

import 'primo-explore-clickable-logo-to-any-link';

You'll need to configure the module by passing it an array of objects as an angular constant:

nametypeusage
urlstringthe url that the clickable link will open
altTextstringfor the aria label and alt tag
iconLinkstringreplace the icon with a custom URL

Translations

You can use translations to access back office text by wrapping the value in curly braces, e.g. {nui.header.logoAlt}. Anything that works in the primo templates link this <span translate="nui.header.logoAlt"></span> will work if it's available in the current scope.

Example

app.constant('clickableLogoLinkConfig', {
  url: '{urls.library}',
  altText: '{nui.header.logoAlt}',
  iconLink: 'http://cdn.library.myinstitution.edu/icon.svg'
});
// Alternately...
app.constant('clickableLogoLinkConfig', {
  url: 'http://library.myinstitution.edu',
  altText: 'My Institution',
  iconLink: 'http://cdn.library.myinstitution.edu/icon.svg'
});

Acknowledgements

Thanks to https://github.com/Alliance-PCJWG/primo-explore-clickable-logo for the idea

1.1.9

1 year ago

1.1.8

2 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

4 years ago

1.1.2

5 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

7 years ago