aem-bookmarklets

0.2.3 • Public • Published

http://panda-soft.io

Build Status Coverage Status dependencies Status devDependencies Status JavaScript Style Guide

AEM Bookmarklets

A set of useful bookamarklets for your browser that can be used with AEM based projects.

Bookmarklets

Author ↔ Publish Toggle

Switching between author and publish can be quite frustrating. You need to remove /editor.html... change domain... etc... wow... doing that 50 times a day can be very annoying.

Add this bookmarklet and whenever you will be on a given page in author mode or on publish is will toggle you between them.

Note, that it works in both /sites.html view and ./editor.html.

WCMMode Disabled Toggle

If you wish to quickly preview the content and then get back to the view you may use this little snippet.

Usage

Some of the bookmarklets will just work OOTB. Others, like Author <-> Publish Toggle require some additional configuration.

In order to generate bookmarklets you just need to run aem-bookmarklets <pathToConfig>.

For the time being the only way to generate the bookmarklet is to checkout the repository add configuration file and run npm run build -- ./my-config-file.js. With next version I will try to wrap the code into an easier to use CLI command.

Configuration

Configuration is pretty simple, all you need to do is create an empty *.js file.

Example:

module.exports = {
    aemEnvironmentMapping: {
        // author instance url                         // publish instance url
        'localhost:4502/content/we-retail/us/en.html': 'localhost:4503/content/we-retail/us/en',
        'author.dev.example.com/content/example-portals/example-portal-pl': 'pl.dev.example.com',
        'author.dev.example.com/content/example-portals/example-portal-europe/en': 'europe.dev.example.com/en',
        'author.dev.example.com/content/example-portals/example-portal-europe/fr': 'europe.dev.example.com/fr',
        'author.dev.example.com/content/example-portals/example-portal-europe/de': 'europe.dev.example.com/de',
    },
    publishViewExtension: '.html' // this item is relevant when we are clicking from /sites.html on the WCMModeToogle bookmarklet 
};

We need to provide this configuration as usually the paths on dispatcher are way shorter then the ones on author instance. Thus we need this mapping between URL to author content and the URL to publish

Development

  1. npm install
  2. npm test
  3. npm run build -- <config> - in case config is not provided it will fallback to config.js

Package Sidebar

Install

npm i aem-bookmarklets

Weekly Downloads

5

Version

0.2.3

License

MIT

Unpacked Size

27.9 kB

Total Files

17

Last publish

Collaborators

  • zietas