wagtail-simple-gallery


Namewagtail-simple-gallery JSON
Version 0.10.1 PyPI version JSON
download
home_pagehttps://github.com/temeez/wagtail-simple-gallery
SummaryA simple gallery app for Wagtail.
upload_time2024-05-24 14:50:21
maintainerNone
docs_urlNone
authorTeemu Nieminen
requires_pythonNone
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 - 6.1.x & Django 2.2.x - 5.0.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": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "wagtail cms model page templatetags",
    "author": "Teemu Nieminen",
    "author_email": "temeez.dev@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/9b/01/8a3db7094ee2670c07218ae7011f79a336b72bfc647492c31238d2ec96bc/wagtail_simple_gallery-0.10.1.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 - 6.1.x & Django 2.2.x - 5.0.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.1",
    "project_urls": {
        "Homepage": "https://github.com/temeez/wagtail-simple-gallery"
    },
    "split_keywords": [
        "wagtail",
        "cms",
        "model",
        "page",
        "templatetags"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9b018a3db7094ee2670c07218ae7011f79a336b72bfc647492c31238d2ec96bc",
                "md5": "876f3ba877db118b8fba92aebf69dd7c",
                "sha256": "028f19a70d8952bbc886d676f9e22ac889e50e0643a72fab74a2073844368b97"
            },
            "downloads": -1,
            "filename": "wagtail_simple_gallery-0.10.1.tar.gz",
            "has_sig": false,
            "md5_digest": "876f3ba877db118b8fba92aebf69dd7c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 17302,
            "upload_time": "2024-05-24T14:50:21",
            "upload_time_iso_8601": "2024-05-24T14:50:21.429761Z",
            "url": "https://files.pythonhosted.org/packages/9b/01/8a3db7094ee2670c07218ae7011f79a336b72bfc647492c31238d2ec96bc/wagtail_simple_gallery-0.10.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-24 14:50:21",
    "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.23116s