Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

apostrophe-anchors

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apostrophe-anchors

An `improve` bundle that adds anchoring capability to existing `apostrophe-widgets`.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

apostrophe-anchors

An improve module that adds an ID wrapper around apostrophe-widgets, useful for navigating to widgets via anchors.

Options

Use an existing schema field as a default value for the anchor

Pass anchorDefault: MY-SCHEMA-STRING-FIELD-NAME as part of your widget configuration. This will default back to a slugified version of the given field's value. In the case of anchordId already having a value, it will not be overwritten. If given default field is empty, don't try to assign a value.

  // app.js
  // .. other configuration
  'artwork-widgets':{
    extend: 'apostrophe-pieces-widgets',
    anchorDefault: 'title' // existing string field on the widget
  },

Disable anchor fields for particular widget

Pass anchors: false as part of your widget configuration.

  // app.js
  // .. other configuration
  'artwork-widgets':{
    extend: 'apostrophe-pieces-widgets',
    anchors: false
  },

Custom attribute in the markup

This would be useful if doing custom front-end behavior. The default attribute is id.

  // app.js
  // .. other configuration
  'apostrophe-anchors-widgets': {
    anchorsAttribute: 'data-override'
  }

The above will wrap your widget in <div class="apos-area-widget-wrapper ui-draggable" data-apos-widget-wrapper="image" data-override="MY-VALUE">

Keywords

FAQs

Package last updated on 17 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc