Skip to main content

plone.org front page like tabs user editable

Project description

Introduction

Kupu Tabs enables end user editable plone.org like front page tabs in WYSIWYG editors.

This is a generic Javascript/CSS library and can be pluggd in to any WYSIWYG editor. Currently Kupu is supported.

Benefits and use cases

  • Where there is plenty of content on the page, but splitting it up is unsuitable and we do not want the user navigate away from the page

  • Suitable for content where the reading order is not critical

  • No page loads - better user experience

  • Fact pages (http://plone.org front page)

  • Data sheets

  • Accessibility - if Javascript is not supported renders as a normal page

  • Printability - prints as a normal page

Installation

Install via buildout

eggs =

collective.kuputabs

zcml =

collective.kuputabs

Usage - Plone

Open any Kupu editable content.

Write a tab name and choose “Tab” as its style from Kupu style drop down.

All text after Tab until the next Tab section or the end will be placed inside a tab container. Tab’ed text will be placed inside a tab container.

You can choose which tab is open by default with Tab (open by default) style.

There is two example style files: kuputabs.css.dtml for any Plone theme (variable colors) and kuputabs2.css which is more generic one.

Usage - Generic HTML

Create a container DIV for your content. Usually this is #content or similar and already provided your CMS/blog/whatever.

Add class “kuputab-tab-definer” for <h2> elements you want to be tabs. Add class “kuputab-tab-definer-default” for the tab which is open by default.

Include kuputabs.js on your page. Include kuputabs-alternative.css stylesheet or create your own.

Voila.

Under the hood

When the page is loaded in the view mode, Javascript parses all kuputabs-tab sections and builds a tab container from them. If Javascript is disabled the content will appear under normal Subheading styles.

There is an important distinction with two kind of CSS classes

  • kuputab-tab-definer is h2 element which marks the beginning of the tab

  • all content until the end of kuputab-tab-definer parent element or next kuputab-tab-definer goes to this tab

  • kuputab-tab-definer content is mutated to kuputab-tab-container which is placed at the bottom of kuputab-tab-definer container element

document.designMode attribute is used to determine whether the visitor views the page or is it under WYSIWYG editor.

Author

Mikko Ohtamaa

Twinapex Research, Oulu, Finland - High quality Python hackers for hire

Sponsorship

Thanks to our fabulous sponsors.

London School of Marketing.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

collective.kuputabs-0.1.tar.gz (9.3 kB view details)

Uploaded Source

File details

Details for the file collective.kuputabs-0.1.tar.gz.

File metadata

File hashes

Hashes for collective.kuputabs-0.1.tar.gz
Algorithm Hash digest
SHA256 d4efe220ff6b4768aab984c924c2b6b9fcc0f8c048d56ee1ae7e9da4ba123b88
MD5 50158cf63c19050bc273cd1162f3c8c8
BLAKE2b-256 6bbd71be2f2d2f5d9f2b3ec6b7c9e9c3f71e54828b40b6bbbc5cac8a6187f6fa

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