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

apostrophe-events

v3.0.0

Published

Calendar of events for the Apostrophe content management system

Downloads

312

Readme

CircleCI

apostrophe-events

This bundle provides a complete foundation for displaying upcoming events with the Apostrophe CMS.

The bundle consists of three Apostrophe modules (in a single npm module):

  • apostrophe-events
  • apostrophe-events-pages
  • apostrophe-events-widgets

The apostrophe-events module provides the ability to create and edit events and manage their start and end dates and times. There is support for repeating events.

The apostrophe-events-pages module displays events on a page. It extends the apostrophe-pieces-pages module. The default view displays only upcoming events.

The apostrophe-events-widgets module provides an apostrophe-events widget, which you can use to select events to appear anywhere on your site. Events that have ended do not appear in widgets.

These three modules extend apostrophe-pieces, apostrophe-pieces-pages and apostrophe-pieces-widgets, and you can extend them further as well.

Example configuration

For a single collection of events:

// in app.js
// We must declare the bundle!
bundles: [ 'apostrophe-events' ],
modules: {
  'apostrophe-events': {},
  'apostrophe-events-pages': {},
  'apostrophe-events-widgets': {},
  'apostrophe-pages': {
    // We must list `apostrophe-events-page` as one of the available page types
    types: [
      {
        name: 'apostrophe-events-page',
        label: 'events'
      },
      {
        name: 'default',
        label: 'Default'
      },
      {
        name: 'home',
        label: 'Home'
      }
    ]
  }
}

Multiple collections of events

One way to create two or more distinct collections of events is to create separate events pages on the site, and use the "with these tags" feature to display only events with certain tags.

Another approach is to extend the modules, creating new modules and a completely separate admin bar item for managing the content. If you take this approach, you must set a distinct name property when configuring your subclass of apostrophe-events, such as meeting. This will be value of type in the database for each event of this subclass.

The latter approach is often best as it requires less user training to avoid confusion. The former approach has its own advantages, notably that it is easier to aggregate content and have it appear in multiple places intentionally.

Filtering by year, month and day

The apostrophe-events module provides cursor filters named year, month, and day. For year the value should be a 4-digit year. For month the value should be in YYYY-MM format. For day the value should be in YYYY-MM-DD format.

All events which are in progress at any point during the specified year, month or day will be included in the results.

These filters are marked safeFor: public and can be used with the piecesFilters option in apostrophe-events-pages.

For example:

// in lib/modules/apostrophe-events-pages/index.js
  piecesFilters: [
    {
      name: 'year'
    }
  ]
<!-- In lib/modules/apostrophe-events-pages/views/index.html -->
<li><a class="{{ 'active' if not data.query.year }}" href="{{ here({ year: null }) }}">Upcoming</a></li>
{% for year in data.piecesFilters.year %}
  <li><a class="{{ 'active' if data.query.year == year.value }}" href="{{ here({ year: year.value }) }}">{{ year.label }}</a></li>
{% endfor %}