Skip to content

eea/volto-tabs-block

Repository files navigation

volto-tabs-block

Releases

Pipeline Lines of Code Coverage Bugs Duplicated Lines (%)

Pipeline Lines of Code Coverage Bugs Duplicated Lines (%)

Volto add-on

Features

IMPORTANT! Because this depends on @eeacms/volto-block-style, you should always load this addon as the last addon in Volto project configuration or after @eeacms/volto-block-style.

Tabs Block

Getting started

Try volto-tabs-block with Docker

  git clone https://github.com/eea/volto-tabs-block.git
  cd volto-tabs-block
  make
  make start

Go to http://localhost:3000

make start now defaults to Volto 18. To run the same setup against Volto 17, use:

  VOLTO_VERSION=17 make
  VOLTO_VERSION=17 make start

Add volto-tabs-block to your Volto project

  1. Make sure you have a Plone backend up-and-running at http://localhost:8080/Plone

    docker compose up backend
  2. Start Volto frontend

  • If you already have a volto project, just update package.json:

    "dependencies": {
        "@eeacms/volto-tabs-block": "*"
    }

    and volto.config.js:

    const addons = ['@eeacms/volto-tabs-block'];
  • If not, create one with Cookieplone, as recommended by the official Plone documentation for Volto 18+:

    uvx cookieplone project
    cd project-title
    

    Then install the add-on in your frontend project. For Cookieplone-based Volto 18 and 19 projects, Plone documents pnpm usage:

    pnpm --filter <name-of-your-policy-add-on> add @eeacms/volto-tabs-block
    

    Then add @eeacms/volto-tabs-block to the addons key in your project's package.json or declare it in volto.config.js.

  1. Install or update dependencies, then start the project:

    make install
    

    For a Cookieplone project, start the backend and frontend in separate terminals:

    make backend-start
    make frontend-start
    

    For a legacy Volto 17 project, install the package with yarn and restart the frontend as usual.

  2. Go to http://localhost:3000

  3. Happy editing!

Upgrade

Upgrading to 10.x

This version requires Volto >= 17.18 or Volto 18+. It removes the custom EditBlockWrapper and uses Volto's built-in block chrome provided by BlocksForm.

Breaking changes

  • Removed EditBlockWrapper.jsx. Any code importing EditBlockWrapper from @eeacms/volto-tabs-block will break. Use Volto's built-in EditBlockWrapper from @plone/volto/components/manage/Blocks/Block/EditBlockWrapper if you need a custom wrapper.
  • Removed custom edit toolbar styles. The edit.less styles that powered the custom inner block toolbar have been removed. Inner blocks now use Volto's default block chrome.

Upgrading to 7.0.0

Version 7 introduces the following breaking changes:

  • The templates are now variations of the default template, so if you have custom templates, you need to update them to be variations of the default template.
  • All variations have schema enhancers, see https://github.com/eea/volto-eea-website-theme/blob/develop/src/index.js#L40 for example on how to customize the variation schema.
  • Some defaults have been changed, see the schema.js files for any default values.
  • Tabs now have the ability to reference an Image or use a Semantic UI icon within the tab title, even allowing the hiding of the text title.
  • Responsive template no longer uses react-responsive-tabs styles but use accordion classes when it's transformed into accordion. Bring your own style for the accordion if you want to customize it.
  • Cleaned up styling in favor of Semantic UI styling and to bring your own styling.
  • Better i18n support for the block especially in edit mode.

Release

See RELEASE.md.

How to contribute

See DEVELOP.md.

Copyright and license

The Initial Owner of the Original Code is European Environment Agency (EEA). All Rights Reserved.

See LICENSE.md for details.

Funding

European Environment Agency (EU)

About

This add-on enables ad-hoc grouping of Volto blocks under sections and tabs

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors