0.7.3 • Published 5 years ago

crds-shared-header v0.7.3

Weekly downloads
1
License
BSD-3-Clause
Repository
-
Last release
5 years ago

crds-shared-header

crds-shared-header is a framework-agnostic implementation of Crossroads' global header.

Requirements

This project requires the following dependencies...

Usage

Install this package via NPM by executing the following command in your project directory...

npm install crds-shared-header --save

Include the compiled bundle before the closing <body> tag in your HTML like this...

<script src="./node_modules/crds-shared-header/dist/bundle.js"></script>

The header class will be available on the global CRDS object. Instantiate and render like so...

<script>
(function(){
  var options = { el: '[data-header]' };
  var header = new CRDS.SharedHeader(options);
      header.render();
})();
</script>

The following options can be passed when the object is instantiated...

OptionsDescriptionDefault
elSelector to bind the rendered header to[data-header]
contentBlockTitleThe title of the contentBlock used to populate the navigationsharedGlobalHeader
contentBlockCategoriesDefines category containing contentBlockTitle['common']
userMenuContentBlockTitleThe title of the contentBlock used to populate a signed-in user's menusharedGlobalHeaderUserMenu
userMenuContentBlockCategoriesDefines category containing userMenuContentBlockTitle['common']
cmsEndpointEnvironmentally specific URL to the CMShttps://contentint.crossroads.net/
appEndpointURL prepended to the sign-in buttonhttps://int.crossroads.net/
imgEndpointURL prepended to the user avatar imageshttps://gatewayint.crossroads.net/gateway/api/image/profile/
crdsCookiePrefixprefix to prepend to environment's cookie names. int would be intsessionIdint

Authentication

When a user logs into the site, the sign-in button at the right side of the menu should be replaced with their profile image and a dropdown menu containing account specific links. Currently, the script is configured to respond accordingly whenever a cookie named ${crdsCookiePrefix}sessionId is set for the current session.

document.cookie = 'intsessionId=21864538764'; //required
document.cookie = 'username=Sean'; // optional

Browser Support

In order to support IE versions 10 and 11, you'll need to include the following polyfills in your page/project...

License

This project is licensed under the 3-Clause BSD License.

0.7.3

5 years ago

0.7.2

6 years ago

0.7.1

6 years ago

0.7.0

6 years ago

0.6.2

6 years ago

0.6.0

6 years ago

0.5.5

6 years ago

0.5.4

6 years ago

0.5.3

6 years ago

0.5.2

6 years ago

0.5.1

6 years ago

0.5.0

7 years ago

0.4.17

7 years ago

0.4.16

7 years ago

0.4.15

7 years ago

0.4.14

7 years ago

0.4.13

7 years ago

0.4.12

7 years ago

0.4.11

7 years ago

0.4.10

7 years ago

0.4.5

7 years ago

0.4.4

7 years ago

0.4.3

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago

0.2.14

7 years ago

0.2.13

7 years ago

0.2.12

7 years ago

0.2.11

7 years ago

0.2.10

7 years ago

0.2.9

7 years ago

0.2.8

7 years ago

0.2.7

7 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago