Skip to main content

Toolbar for Plone

Project description

plone.app.toolbar installs a new toolbar for Plone.

For the moment, it is an experiment only, but hopefully it will be soon ready for prime time.

Installation

To install toolbar drop following lines to your buildout.cfg:

[instance]
eggs =
    ...
    plone.app.toolbar

[versions]
plone.app.jquery = 1.7.2
plone.app.jquerytools = 1.4
plone.tiles = 1.0b2
Products.ResourceRegistries = 2.1.1
plone.app.toolbar = 1.0

In case this document gets outdated use latest versions of eggs in versions section.

Make sure you install the “Plone Toolbar” profile when creating your Plone site or include plone.app.toolbar:default profile in your metadata.xml..

To start developing plone.app.toolbar you can find buildout at buildout.deco repository.:

https://github.com/plone/buildout.deco/blob/master/toolbar-2.0.cfg

How it works

Registers toolbar tile which creates toolbar html on every page in twitter bootstrap structure and is hidden by default. Toolbar tile also lists resources from toolbar skin in data-iframe-resources attribute of top element.

<div style="display: none;"
     data-iframe="example"
     data-iframe-resources="resource1.js;resource2.css;...">
  <div class="navbar">
    ...
  </div>
</div>

Elements with data-iframe attribute are picked by iframed.js and inserts resources found in data-iframe-resources attribute. iframed.js script also takes care that dropdown in toolbar which goes outside iframe area stretches it in transparent way so that user doesn’t even notice it.

Same transparent stretching of iframe is used when overlay is opened. This is done by plone.overlay.js script. Example of how to open overlay when user click on Edit action in toolbar would be:

$('#plone-toolbar ul.nav > li#plone-action-edit > a').ploneOverlay({
  after_load: function(overlay) {
    $.plone.cmsui.bootstrapOverlayTransform(overlay.el, overlay.loaded_data);
  }
});

More examples of this can be found in plone.cmsui.js script.

Since in current Plone we’re not using plone.app.blocks to render tiles we provide plone toolbar viewlet which renders toolbar tile. This is done by bbb code that also makes sure that plone.app.toolbar is nicely integrated into current Plone, eg: hidding old green edit bar, …

Diazo rules

First we need to copy toolbar’s html code, which will be picked by iframed.js:

<append theme="/html/body"
    content="//div[@data-iframe='toolbar']" />

Then in case we are not copying all resources from Plone to theme we have to include iframed.js:

<append theme="/html/head">
    <script type="text/javascript"
        src="++resource++plone.app.toolbar/src/iframed.js"></script>
</append>

Above 2 rules should be enought so that your theme will support plone.app.toolbar

More on plone.overlay.js

TODO: once jquery.form.js is integrated into $.plone.Overlay write documentation for it.

More on plone.cmsui.js

TODO: once it gets fairly working some documentation would be nice.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plone.app.toolbar-1.0.tar.gz (1.1 MB view details)

Uploaded Source

File details

Details for the file plone.app.toolbar-1.0.tar.gz.

File metadata

File hashes

Hashes for plone.app.toolbar-1.0.tar.gz
Algorithm Hash digest
SHA256 8c898c42a6dd05098c81720ee41f6229179b6a243d762a41d0274424dfd69ba2
MD5 8acf0825622551726112e69e9346b72d
BLAKE2b-256 076139d551ab73f1ccc49e92c0c7279c08c9d82c8ec5d55b4a56ea374dc2133f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page