You can separate widgets into reusable elements. This allows you to reposition individual fragments on a widget without requiring knowledge of, or access to, the underlying presentation code. Extension bundles can similarly deliver stand-alone widgets, or stand-alone elements, or a combination of widgets and elements. You can have stand-alone elements shared across different widgets, or elements local to a particular widget. The example below shows how the modified extension structure would look when supporting elements:

<EXTENSION NAME> : the root folder of your extension
ext.json
readme.txt
element/
    <element-name>/
        templates/
            template.txt
        element.json
widget/
    <widget-type>/
        widget.json
        readme.txt
        elements/
            <element-name>/
                templates/
                template.txt
            element.json
        templates/
            display.template
            edit.template
        js/
            <widget type>.js
        less
            widget.less
        locales/
            en/
                ns.<widget type>.json
            de/
                ns.widget type>.json
        images/

You can define elements either as stand-alone (shared) by creating a top level directory in your extension, or as part of a widget directory. Typically an element directory will contain one or more named directories containing the HTML, Less, and locale fragments related to the element. There is also an element manifest file. The contents of element.json might look like this:

{
  "title": "Product Title",
  "inline" : true,
  "supportedWidgetType" : ["product-details", "sale-carousel", ...],
}

The attributes available for element manifests are:


Copyright © 1997, 2016 Oracle and/or its affiliates. All rights reserved. Legal Notices