Download the PHP package xddesigners/silverstripe-better-tabs without Composer

On this page you can find all versions of the php package xddesigners/silverstripe-better-tabs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package silverstripe-better-tabs

Silverstripe Better Tabs

Tame CMS forms that have too many tabs. When a tabset's tab bar would wrap onto more than one row, the overflowing tabs collapse into a "More ▾" dropdown so the bar stays on a single row. The active tab is always kept visible.

Works with the tabs you already have — including nested tabs (addFieldToTab('Root.Tab.SubTab', $field)), which Silverstripe supports out of the box.

Requirements

Installation

Run dev/build?flush=1 once. No configuration or code changes are needed — it enhances the existing CMS tab bars automatically.

How it works

The module adds a small CSS + JS enhancement to the CMS (via LeftAndMain.extra_requirements_javascript / _css). The script:

It is dependency-free (no jQuery/entwine required) and makes no server-side or data changes.

The overflow menu is on by default. If you only want the other features (icons, colours, dropdown mode, breadcrumb) and would rather leave the tab bar native, turn it off in YAML:

Tab icons & colours

All configured in PHP, in getCMSFields() — no YAML per tab. Every setter returns the field, so they chain:

Icons

Give any tab an icon with setIcon(). Use a built-in CMS font-icon name (without the font-icon- prefix):

Tab::setIcon() is built into Silverstripe; this module adds the same to TabSet so a tab group can have an icon too. Icons are vertically aligned with the label and carried into the overflow dropdown.

Font Awesome icons

Pass Font Awesome classes to setIcon():

Enable Font Awesome in the CMS from your project YAML (e.g. app/_config/better-tabs.yml):

Colours

Colour a tab's label (and optionally its background):

Works on both leaf Tabs and TabSets, at every level and in the overflow dropdown (text, icon and background colours all propagate). A tab given a background colour fades slightly while inactive, so the selected tab stays obvious.

Icons on the CMS view tabs

The edit-form view tabs (Content / Settings / History, and the like) aren't Tab/TabSet fields, so setIcon() can't reach them. Give them icons with a small YAML map — each key is matched against a path segment of the tab's link:

Sub-tabs as a dropdown

By default a tab group's sub-tabs render as an inline segmented pill bar. For a group with many (or deeply nested) sub-tabs you can instead turn it into a website-style dropdown menu: the group's own tab gets a ▾ caret and, on hover/click, opens a menu of its sub-tabs (groups nested inside open as flyout submenus). All of that group's in-body sub-tab bars are hidden — navigation happens through the menu, which keeps deep forms tidy. Opt in per tab group, in PHP:

setMode('pills') (the default) switches it back. Only the group you mark changes; every other tabset keeps the pill bar. Flyouts open to the right, flipping left only when short on space. Pairs well with the breadcrumb.

Theming (CSS variables)

The module's default colours are CSS custom properties — override any of them in your admin CSS (each falls back to the matching Bootstrap/CMS variable):

Breadcrumb for deep tabs

For tabsets nested two or more levels deep, you can show a breadcrumb of the active path (e.g. "Deep › Account › Profile"), rendered just below the deepest sub-tab strip. The crumbs are clickable — selecting one jumps to that tab (resetting the levels below it to their first tab, like clicking the tab itself would).

Enable it per form in getCMSFields():

The second argument shows the breadcrumb on all tabs — including top-level tabs that have no sub-tabs (rendered as a single crumb) — so the breadcrumb is consistent across the whole form.

Call it on a specific tab group instead of Root to scope the breadcrumb to just that tab and its children — no breadcrumb shows on the other top-level tabs:

Or turn it on globally for every CMS form, in your project YAML:

Translations

The "More" overflow label is translatable via Silverstripe i18n, shown in the CMS user's locale. Translations ship for en, nl, de, it, es, fr (lang/<locale>.yml).

License

BSD-3-Clause.


All versions of silverstripe-better-tabs with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
silverstripe/framework Version ^6.0
silverstripe/admin Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package xddesigners/silverstripe-better-tabs contains the following files

Loading the files please wait ...