npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

magnolia-tabs

v1.0.6

Published

Magnolia tabs is a light module for Magnolia CMS which provides you a Tabs component and tabs macro.

Downloads

9

Readme

Magnolia tabs

Magnolia tabs is a light module for Magnolia CMS which provides you a Tabs component and tabs macro to segregate your content.

Installation

With Magnolia CLI just run: mgnl install magnolia-tabs.

Alternatively git clone it from https://bitbucket.org/ndq1/magnolia-tabs and copy source files that you need into your Magnolia's modules directory.

Availability

To be able to use tabs as a component in your template add tabs as available component in any area you want by using Magnolia CLI:

mgnl add-availability magnolia-tabs:components/tabs/tabs <path-to-page[@area]> [options]

or by adding properties in definition manually:

...
areas:
  some-area:
    availableComponents:
      tabs:
        id: magnolia-tabs:components/tabs/tabs
...

You also will need some components to add in your tab. Edit availableComponents property in the same way in templates/components/tabs/subcomponents/tab.yaml file

CSS and JS

You can find source files in webresources/src folder. Import and modify according to your needs.

Usage

After successful installation you can use it both ways: as a component or as a macro by including it to your template.

'Tabs' will be available as a component when creating a new component in selected area.

And you can use macro like this:

[#include './macros/tabs.ftl']

[@tabs; scope]
    [@tab name='tab1' displayName='Tab one' active=true scope=scope]
        Tab1: Lorem ipsum dolor sit amet
    [/@tab]
    
    [@tab name='tab2' displayName='Tab two' scope=scope]
        Tab2: Lorem ipsum dolor sit amet, consectetur adipisicing elit.
    [/@tab]
    
    [@tab name='tab3' displayName='Tab three' scope=scope]
        Tab3: Lorem ipsum dolor sit amet, consectetur adipisicing elit. Culpa dolore eveniet exercitationem iste molestiae perspiciatis quibusdam recusandae saepe sapiente veniam.
    [/@tab]
[/@tabs]

or combining with other directives like include or loop:

[#include '../../macros/tabs.ftl']
[#assign data = [
    {'name': 'tab1', 'displayName': 'Tab one', 'active': true, 'content': 'Tab1: Lorem ipsum dolor sit amet'},
    {'name': 'tab2', 'displayName': 'Tab two', 'active': false, 'content': 'Tab2: Lorem ipsum dolor sit amet, consectetur adipisicing elit.'},
    {'name': 'tab3', 'displayName': 'Tab three', 'active': false, 'content': 'Tab3: Lorem ipsum dolor sit amet, consectetur adipisicing elit. Culpa dolore eveniet exercitationem iste molestiae perspiciatis quibusdam recusandae saepe sapiente veniam.'}
]]

[@tabs; scope]
    [#list data as el]
        [@tab?with_args(el) scope=scope]
          ${el.content!}
        [/@tab]
    [/#list]
[/@tabs]

Keep in mind, that all scope occurrences are required to work properly

You can pass to each tab name, displayName and active as a parameters and any HTML you want between opening and closing tags

Both examples will output whole HTML with triggers and content segregated in their own containers respectively:

<section class="tabs">
    <nav aria-label="Tabs navigation">
        <ul class="triggers-container" role="tablist">
            <li class="trigger-item" role="presentation">
                <a href="#tab-content-tab1"
                   id="tab-trigger-tab1"
                   class="tab-trigger active"
                   aria-selected="true"
                   aria-controls="tab-content-tab1"
                   role="tab">
                    Tab one
                </a>
            </li>
            <li class="trigger-item" role="presentation">
                <a href="#tab-content-tab2"
                   id="tab-trigger-tab2"
                   class="tab-trigger active"
                   aria-selected="false"
                   aria-controls="tab-content-tab2"
                   role="tab">
                    Tab two
                </a>
            </li>
        </ul>
    </nav>

    <section class="content-container" aria-live="polite">
        <section id="tab-content-tab1"
                 class="tab-content active"
                 aria-hidden="false"
                 aria-labelledby="tab-trigger-tab1"
                 role="tabpanel">
            Tab1: Lorem ipsum dolor sit amet
        </section>
        <section id="tab-content-tab2"
                 class="tab-content"
                 aria-hidden="true"
                 aria-labelledby="tab-trigger-tab2"
                 role="tabpanel">
            Tab2: Lorem ipsum dolor sit amet
        </section>
    </section>
</section>