Skip to main content

Adds icon plugin to django CMS.

Project description

pypi build coverage

django CMS Icon is a plugin for django CMS that allows you to insert an icon (font or svg) into your project.

This addon is compatible with Divio Cloud and is also available on the django CMS Marketplace for easy installation.

preview.gif

Contributing

This is a an open-source project. We’ll be delighted to receive your feedback in the form of issues and pull requests. Before submitting your pull request, please review our contribution guidelines.

One of the easiest contributions you can make is helping to translate this addon on Transifex.

Documentation

See REQUIREMENTS in the setup.py file for additional dependencies:

  • Python 2.7, 3.4 or higher

  • Django 1.11 or higher

Installation

For a manual install:

  • run pip install djangocms-icon

  • add djangocms_icon to your INSTALLED_APPS

  • run python manage.py migrate djangocms_icon

Configuration

The django CMS Icon plugin ships with Font Awesome as default. You can configure this through:

DJANGOCMS_ICON_SETS = [
    ('fontawesome', 'fa', 'Font Awesome'),
    (ICONSET, 'icon', 'SVG icons'),
]

In this example we keep the Font Awesome default and add our own SVG icon set on top of it. ICONSET is an external reference to a JSON file at the root of your project setting up your custom SVG icon set:

with open('iconset.json') as fh:
    ICONSET = fh.read()

Here an example of its content:

{
    "svg": true,
    "spritePath": "sprites/icons.svg",
    "iconClass": "icon",
    "iconClassFix": "icon-",
    "icons": [
        "icon-icon1",
        "icon-icon2",
        "..."
    ]
}

svg and spritePath are only required when using an SVG set. You can also use this to generate your own icon font definitions or add them straight to the DJANGOCMS_ICON_SETS setting.

djangocms-boilerplate-webpack can generate the iconset.json automatically for you through gulp icons.

In addition you need to load the resources for your fonts in /admin/djangocms_icon/includes/assets.html through your project in order for the icon picker to pick up your custom icons.

Make sure the icons names contain the iconset prefix as shown in the example, the widget will determine the iconset based on that. They can be omitted if only one iconset is used.

Running Tests

You can run tests by executing:

virtualenv env
source env/bin/activate
pip install -r tests/requirements.txt
python setup.py test

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

djangocms-icon-1.1.0.tar.gz (67.0 kB view details)

Uploaded Source

Built Distribution

djangocms_icon-1.1.0-py3-none-any.whl (78.0 kB view details)

Uploaded Python 3

File details

Details for the file djangocms-icon-1.1.0.tar.gz.

File metadata

  • Download URL: djangocms-icon-1.1.0.tar.gz
  • Upload date:
  • Size: 67.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for djangocms-icon-1.1.0.tar.gz
Algorithm Hash digest
SHA256 ff06cd42d022df332022b87858b9e34a56dbc1a88b6a2fbd3afc5380fbaef235
MD5 84b1d6d16c6732ad855723f29f3ea941
BLAKE2b-256 dcaa1db209ddd9381f6826d8e4ccfefb1e69bcf40bac67772a0cd7a69a269c85

See more details on using hashes here.

Provenance

File details

Details for the file djangocms_icon-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: djangocms_icon-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 78.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for djangocms_icon-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c43395c6ea34a7c36dde82fc63d9eaf31820fd103b3ed13470db654cac0bb462
MD5 2814022bbc1d5a5178a326b71b9f5940
BLAKE2b-256 6ac183fa207f2e3842e33c9b385b4f3c71bd8bbfc4f0a700203f1d0111633c3b

See more details on using hashes here.

Provenance

Supported by

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