Skip to main content

Dynamic, interactive grid layout for the Django CMS Wagtail.

Project description

Wagtail Gridder

Wagtail Gridder is a Bootstrap 5 enabled layout for the Wagtail CMS. Grid Items are created within categories and displayed on a Grid Index Page. The JavaScript libraries Gridder and MixItUp are included.

Requirements

  • Wagtail >= 6.3
  • Bootstrap >= 5

If you are using Bootstrap 4, use a version lower than 2.0: pip install wagtailgridder<2.

Installation

Wagtail Gridder can then be installed like most Django apps: pip install wagtailgridder.

Then add wagtailgridder to your list of INSTALLED_APPS in your Django settings file. You will also need to add wagtail.contrib.modeladmin, if you haven't already. Your final settings may look something like this:

WAGTAIL_APPS = [
    'wagtail.contrib.forms',
    'wagtail.contrib.redirects',
    'wagtail.embeds',
    'wagtail.sites',
    'wagtail.users',
    'wagtail.snippets',
    'wagtail.documents',
    'wagtail.images',
    'wagtail.search',
    'wagtail.admin',
    'wagtail',

    'modelcluster',
    'taggit',

    'wagtailgridder',
]

INSTALLED_APPS = INSTALLED_APPS + WAGTAIL_APPS

This Wagtail Gridder template extends base.html, with the hope that this allows inclusion or your site's top and bottom navigation without much effort. There is an example base.html provided.

Then log into the Wagtail admin, and you should see a "Grid Layouts" section of the menu. The first thing you will want to do is add some "Grid Categories." After that, you can create "Grid Items" (the cards, pictured below) and put them together on a "Grid Index Page."

Settings

WAGTAILGRIDDER_CLEAR_CACHE = False

The default Wagtail Gridder template caches the grid display area to reduce the number of queries performed. Setting WAGTAILGRIDDER_CLEAR_CACHE = True in your Django settings will clear the entire Django cache after a page is edited. This approach is necessary, as Django does not currently support deletion from the cache by pattern. Setting this to True will clear your cache every time you save a Wagtail page. If anyone knows of a better solution that works for Django's supported cache systems, please let us know!

WAGTAILGRIDDER_GRID_ITEM_PARENT_PAGE_TYPES = ["GridIndexPage"]

By default, GridItem pages may only be created as children of GridIndexPage pages. To allow GridItem pages under any parent, set WAGTAILGRIDDER_GRID_ITEM_PARENT_PAGE_TYPES = None. See the Wagtail Documentation for more

WAGTAILGRIDDER_GRID_INDEX_PAGE_SUBPAGE_TYPES = ["GridItem"]

By default, GridIndexPage pages may only have GridItem pages as children. To allow GridIndexPage pages to have other child types, set WAGTAILGRIDDER_GRID_INDEX_PAGE_SUBPAGE_TYPES = None. See the Wagtail Documentation for more details.

GridIndexPage is inherited from an abstract model, GridIndexPageAbstract, which you may wish to customize.

Screenshots

Grid Index Page:

Grid Index Page

Grid Index Page, with Grid Item expanded:

Grid Index Page, with Grid Item expanded

Optional featured hero region:

Optional featured hero region

Grid Item landing page:

Grid Item landing page

Editing a Grid Item:

Editing a Grid Item

Editing a Grid Index Page:

Editing a Grid Index Page

Release Notes and Contributors

Maintainer

This package is maintained by the staff of Wharton Research Data Services. We are thrilled that The Wharton School allows us a certain amount of time to contribute to open-source projects. We add features as they are necessary for our projects, and try to keep up with Issues and Pull Requests as best we can. Due to constraints of time (our full time jobs!), Feature Requests without a Pull Request may not be implemented, but we are always open to new ideas and grateful for contributions and our package users.

Project details


Download files

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

Source Distribution

wagtailgridder-2.0.0.tar.gz (805.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wagtailgridder-2.0.0-py3-none-any.whl (37.2 kB view details)

Uploaded Python 3

File details

Details for the file wagtailgridder-2.0.0.tar.gz.

File metadata

  • Download URL: wagtailgridder-2.0.0.tar.gz
  • Upload date:
  • Size: 805.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.1

File hashes

Hashes for wagtailgridder-2.0.0.tar.gz
Algorithm Hash digest
SHA256 e50cfb74de403560848140c422311aa8b36ef728aae68c8be5a55b8cfc2c9c24
MD5 0b942081ff658dbfc1b45ae75634245f
BLAKE2b-256 1bda870f1b1de5d385919d62b9954195cf0d725f197879075d2293dfb8ce653a

See more details on using hashes here.

File details

Details for the file wagtailgridder-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: wagtailgridder-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 37.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.1

File hashes

Hashes for wagtailgridder-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b4fff01d94ccddaa992956281312485d88a2241b1dd408cad15e877c6697d9d5
MD5 b40687ee47ca5e39655b137803edf1e8
BLAKE2b-256 3ae454fd17498089a75848f2624f5d4ceaf7db8ee0dd89f8bcbb551229923d3d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page