wagtail-simple-gallery


Namewagtail-simple-gallery JSON
Version 0.10.0 PyPI version JSON
download
home_pagehttps://github.com/temeez/wagtail-simple-gallery
SummaryA simple gallery app for Wagtail.
upload_time2023-10-05 13:07:06
maintainer
docs_urlNone
authorTeemu Nieminen
requires_python
licenseMIT License
keywords wagtail cms model page templatetags
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Wagtail Simple Gallery
Is an extension for Torchbox's [Wagtail CMS](https://github.com/torchbox/wagtail) for creating a simple image gallery either by creating a page using the template or a templatetag.

Current version works with Wagtail 2.8.x - 5.1.x & Django 2.2.x - 4.1.x.


## Getting started
### Install
- Install via pip `pip install wagtail-simple-gallery`.
- Add `wagtail_simple_gallery` to `INSTALLED_APPS` in your project settings.
- Run `python manage.py migrate wagtail_simple_gallery`.

### Use
- Create a new collection in Wagtail CMS: **Settings -> Collections**.
- Add or upload images to the collection.
- Create a new page using the **Gallery index** type and select the new collection.
- You are done, preview or publish the page and you should see the gallery in action.


## Features / Options
- Toggleable [Lightbox](https://feimosi.github.io/baguetteBox.js/) for viewing images.
- Show images from selected collection.
- The amount of images shown on one page (before the paginator kicks in) is changeable.
- A crude way to order the images shown on a gallery page. By default newest images are shown first, but this can be changed in the page content settings. If it's set to "Image title" then you can manually order images by inserting `[<number>]` into their title: "[00004] Cute cat".
- Tags.

## Settings
### `SIMPLE_GALLERY_TEMPLATE`
You can override the `SimpleGalleryIndex` page template with this setting. Default: `wagtail_simple_gallery/simple_gallery_index.html`

### `SIMPLE_GALLERY_ADMIN_URL_ROOT`
You can use this with the [Admin Interface](#admin-interface) if you use something other than "admin" for accessing the cms admin panel. Default: `admin`

### `SIMPLE_GALLERY_PAGE_TYPE`
The page type presented to a Wagtail CMS user can be adjusted with this setting. Default: `Gallery index`.

## Templatetags
`{% load wagtailsimplegallery_tags %}`
### `{% simple_gallery %}` inclusion tag
Uses the template **wagtail_simple_gallery/simple_gallery.html**. You can use the simple-gallery style with this tag using: `<link rel="stylesheet" href="{% static 'css/simple-gallery.css' %}">`.

- `collection` (default: None): Show images from this collection. **Required**, example: `{% simple_gallery collection="Root" %}`.
- `tags` (default: None): Filter images by their tags. Example: `{% simple_gallery tags="cats dogs" %}`.
- `image_limit` (default: None): Limit the amount of images to show. Example: `{% simple_gallery image_limit=4 %}`.
- `use_lightbox` (default: True): Use lightbox for viewing images. Example: `{% simple_gallery use_lightbox=False %}`.

### `{% img|original_url %}` filter
- Takes wagtails Image object and returns its real original url instead of the one that wagtail creates. Example: `/media/original_images/foo.jpg`.


### `{% img.alt|hide_num_order %}` filter
- Hides the first occurance of `[<number>]` in the image title. E.g "[0010] Cute cat" -> "Cute cat"


## Template
Look at **simple_gallery_index.html** template for an example or copy paste it and start modifying to make it look a part of your page. Your custom **simple_gallery_index.html** template should reside in **/templates/wagtail_simple_gallery/simple_gallery_index.html**

Or if **simple_gallery_index.html** is good enough for your use, then you can just create a **simple_gallery_base.html** in your own templates directory with the following content:
```
{% extends "base.html" %}

{% block content %}{% endblock %}
```


## Admin Interface
It is suggested to take advantage of the existing Wagtail setting:

`WAGTAILIMAGES_INDEX_PAGE_SIZE = 32`

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/temeez/wagtail-simple-gallery",
    "name": "wagtail-simple-gallery",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "wagtail cms model page templatetags",
    "author": "Teemu Nieminen",
    "author_email": "temeez.dev@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/b5/9d/8de8e7bac557bfb074b0e91f4c795aa9e6312ede08dd862d43d684347047/wagtail-simple-gallery-0.10.0.tar.gz",
    "platform": null,
    "description": "# Wagtail Simple Gallery\r\nIs an extension for Torchbox's [Wagtail CMS](https://github.com/torchbox/wagtail) for creating a simple image gallery either by creating a page using the template or a templatetag.\r\n\r\nCurrent version works with Wagtail 2.8.x - 5.1.x & Django 2.2.x - 4.1.x.\r\n\r\n\r\n## Getting started\r\n### Install\r\n- Install via pip `pip install wagtail-simple-gallery`.\r\n- Add `wagtail_simple_gallery` to `INSTALLED_APPS` in your project settings.\r\n- Run `python manage.py migrate wagtail_simple_gallery`.\r\n\r\n### Use\r\n- Create a new collection in Wagtail CMS: **Settings -> Collections**.\r\n- Add or upload images to the collection.\r\n- Create a new page using the **Gallery index** type and select the new collection.\r\n- You are done, preview or publish the page and you should see the gallery in action.\r\n\r\n\r\n## Features / Options\r\n- Toggleable [Lightbox](https://feimosi.github.io/baguetteBox.js/) for viewing images.\r\n- Show images from selected collection.\r\n- The amount of images shown on one page (before the paginator kicks in) is changeable.\r\n- A crude way to order the images shown on a gallery page. By default newest images are shown first, but this can be changed in the page content settings. If it's set to \"Image title\" then you can manually order images by inserting `[<number>]` into their title: \"[00004] Cute cat\".\r\n- Tags.\r\n\r\n## Settings\r\n### `SIMPLE_GALLERY_TEMPLATE`\r\nYou can override the `SimpleGalleryIndex` page template with this setting. Default: `wagtail_simple_gallery/simple_gallery_index.html`\r\n\r\n### `SIMPLE_GALLERY_ADMIN_URL_ROOT`\r\nYou can use this with the [Admin Interface](#admin-interface) if you use something other than \"admin\" for accessing the cms admin panel. Default: `admin`\r\n\r\n### `SIMPLE_GALLERY_PAGE_TYPE`\r\nThe page type presented to a Wagtail CMS user can be adjusted with this setting. Default: `Gallery index`.\r\n\r\n## Templatetags\r\n`{% load wagtailsimplegallery_tags %}`\r\n### `{% simple_gallery %}` inclusion tag\r\nUses the template **wagtail_simple_gallery/simple_gallery.html**. You can use the simple-gallery style with this tag using: `<link rel=\"stylesheet\" href=\"{% static 'css/simple-gallery.css' %}\">`.\r\n\r\n- `collection` (default: None): Show images from this collection. **Required**, example: `{% simple_gallery collection=\"Root\" %}`.\r\n- `tags` (default: None): Filter images by their tags. Example: `{% simple_gallery tags=\"cats dogs\" %}`.\r\n- `image_limit` (default: None): Limit the amount of images to show. Example: `{% simple_gallery image_limit=4 %}`.\r\n- `use_lightbox` (default: True): Use lightbox for viewing images. Example: `{% simple_gallery use_lightbox=False %}`.\r\n\r\n### `{% img|original_url %}` filter\r\n- Takes wagtails Image object and returns its real original url instead of the one that wagtail creates. Example: `/media/original_images/foo.jpg`.\r\n\r\n\r\n### `{% img.alt|hide_num_order %}` filter\r\n- Hides the first occurance of `[<number>]` in the image title. E.g \"[0010] Cute cat\" -> \"Cute cat\"\r\n\r\n\r\n## Template\r\nLook at **simple_gallery_index.html** template for an example or copy paste it and start modifying to make it look a part of your page. Your custom **simple_gallery_index.html** template should reside in **/templates/wagtail_simple_gallery/simple_gallery_index.html**\r\n\r\nOr if **simple_gallery_index.html** is good enough for your use, then you can just create a **simple_gallery_base.html** in your own templates directory with the following content:\r\n```\r\n{% extends \"base.html\" %}\r\n\r\n{% block content %}{% endblock %}\r\n```\r\n\r\n\r\n## Admin Interface\r\nIt is suggested to take advantage of the existing Wagtail setting:\r\n\r\n`WAGTAILIMAGES_INDEX_PAGE_SIZE = 32`\r\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "A simple gallery app for Wagtail.",
    "version": "0.10.0",
    "project_urls": {
        "Homepage": "https://github.com/temeez/wagtail-simple-gallery"
    },
    "split_keywords": [
        "wagtail",
        "cms",
        "model",
        "page",
        "templatetags"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b59d8de8e7bac557bfb074b0e91f4c795aa9e6312ede08dd862d43d684347047",
                "md5": "6cf347d3e3ad30625e92e434a03e8122",
                "sha256": "73defc574808391ca99c8f5c9a06f635510517d0c452cf9fe8e6d4dd7653f821"
            },
            "downloads": -1,
            "filename": "wagtail-simple-gallery-0.10.0.tar.gz",
            "has_sig": false,
            "md5_digest": "6cf347d3e3ad30625e92e434a03e8122",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 16185,
            "upload_time": "2023-10-05T13:07:06",
            "upload_time_iso_8601": "2023-10-05T13:07:06.582450Z",
            "url": "https://files.pythonhosted.org/packages/b5/9d/8de8e7bac557bfb074b0e91f4c795aa9e6312ede08dd862d43d684347047/wagtail-simple-gallery-0.10.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-05 13:07:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "temeez",
    "github_project": "wagtail-simple-gallery",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "wagtail-simple-gallery"
}
        
Elapsed time: 0.12645s