Skip to content
This repository was archived by the owner on Jan 26, 2021. It is now read-only.

DEGJS/sitecoreUtils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

sitecoreUtils

A utility library for working with the Sitecore CMS.

THIS REPOSITORY IS NO LONGER MAINTAINED

Install

sitecoreUtils is an ES6 module. Consequently, you'll need an ES6 transpiler (Babel is a nice one) and a module loader (SystemJS will do the job) as part of your Javascript workflow.

If you're already using the JSPM package manager for your project, you can install sitecoreUtils with the following command:

$ jspm install github:DEGJS/sitecoreUtils

Usage

Importing individual sitecoreUtils methods:

import { isSitecoreEditMode } from "DEGJS/sitecoreUtils";

let editModeCheck = isSitecoreEditMode();

Importing all sitecoreUtils methods:

import * as sitecoreUtils from "DEGJS/sitecoreUtils";

let editModeCheck = sitecoreUtils.isSitecoreEditMode();

Methods

isSitecoreEditMode(editModeClass, el)

Returns a boolean value depending on whether the site is currently in Sitecore's logged-in Experience Editor mode, based on a class set on a DOM element.

editModeClass

Type: String
Default: sc--edit-mode
The class name that's tested for on a given element

el

Type: DOM element
Default: document.body
The element that's checked for the given class

Browser Support

sitecoreUtils depends on the following browser APIs:

To support legacy browsers, you'll need to include polyfills for the above API.

About

A utility library for working with the Sitecore CMS.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors