All Projects → django-cms → djangocms-snippet

django-cms / djangocms-snippet

Licence: other
django CMS Snippet provides a plugin for django CMS to inject HTML, CSS or JavaScript snippets into your website.

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to djangocms-snippet

djangocms-style
django CMS Style is a plugin for django CMS that allows you to create a HTML container containing classes, styles, ids and other attributes.
Stars: ✭ 39 (-7.14%)
Mutual labels:  addon, django-cms
djangocms-file
django CMS File is a set of plugins for django CMS that allow you to add files to your site You can either choose a single file or an entire folder.
Stars: ✭ 30 (-28.57%)
Mutual labels:  addon, django-cms
videoclip
Easily create videoclips with mpv.
Stars: ✭ 49 (+16.67%)
Mutual labels:  addon
addon-log-viewer
Log Viewer - Home Assistant Community Add-ons
Stars: ✭ 37 (-11.9%)
Mutual labels:  addon
webconverger-addon
How we lock down Firefox
Stars: ✭ 27 (-35.71%)
Mutual labels:  addon
tab-counter
A button badge that shows the number of tabs open in a window
Stars: ✭ 35 (-16.67%)
Mutual labels:  addon
dut-iptv
Github repo containing Kodi addons for CanalDigitaal IPTV, F1 TV, KPN/Telfort/XS4All iTV, NLZiet, Telenet, T-Mobile TV, Videoland and Ziggo Go
Stars: ✭ 26 (-38.1%)
Mutual labels:  addon
python-grass-addon
How to write a Python GRASS GIS 7 addon
Stars: ✭ 45 (+7.14%)
Mutual labels:  addon
dwains-dashboard-addons
Dwains Dashboard Community Addons
Stars: ✭ 112 (+166.67%)
Mutual labels:  addon
AzeriteUI
Custom user interface suite for WoW. Design and code by Lars Norberg and Daniel Troconis.
Stars: ✭ 0 (-100%)
Mutual labels:  addon
addon-portainer
Portainer - Home Assistant Community Add-ons
Stars: ✭ 83 (+97.62%)
Mutual labels:  addon
PyEditorial
A free, open-source Blog CMS based on the "Django" and "Editorial" HTML5 theme.
Stars: ✭ 178 (+323.81%)
Mutual labels:  django-cms
Godot-Material-Icons
Templarian's Material Design Icons for Godot
Stars: ✭ 19 (-54.76%)
Mutual labels:  addon
catalog
Catalog of community maintained components and traits.
Stars: ✭ 104 (+147.62%)
Mutual labels:  addon
glTF-Blender-IO-materials-variants
Blender3D addon for glTF KHR_materials_variants extension
Stars: ✭ 56 (+33.33%)
Mutual labels:  addon
MustardTools
A set of tools for animators/riggers
Stars: ✭ 30 (-28.57%)
Mutual labels:  addon
blender-xray
STALKER (aka xray-engine) import/export plugin for Blender 3D
Stars: ✭ 132 (+214.29%)
Mutual labels:  addon
service.subloader
Kodi automatic subtitles
Stars: ✭ 26 (-38.1%)
Mutual labels:  addon
storybook-addon-next
A no config Storybook addon that makes Next.js features just work in Storybook
Stars: ✭ 184 (+338.1%)
Mutual labels:  addon
3D2D-Textscreens
3D2D Textscreens Garry's Mod Workshop Addon
Stars: ✭ 26 (-38.1%)
Mutual labels:  addon

django CMS Snippet

pypi coverage python django djangocms

django CMS Snippet provides a plugin for django CMS to inject HTML, CSS or JavaScript snippets into your website.

This project is endorsed by the django CMS Association. Join us on Slack.

Warning: We recommend using this plugin only during development:

This plugin is a potential security hazard, since it allows authorized-
users to place custom markup or Javascript on pages bypassing all of
Django's normal sanitization mechanisms. This could be exploited by users
with the right to add snippets to elevate their privileges to superusers.
This plugin should only be used during the initial development phase for
rapid prototyping and testing.

preview.gif

Contribute to this project and win rewards

Because this is a an open-source project, we welcome everyone to get involved in the project and receive a reward for their contribution. Become part of a fantastic community and help us make django CMS the best CMS in the world.

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.

We're grateful to all contributors who have helped create and maintain this package. Contributors are listed at the contributors section.

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.

Installation

For a manual install:

  • run pip install djangocms-snippet
  • add djangocms_snippet to your INSTALLED_APPS
  • run python manage.py migrate djangocms_snippet

Djangocms-snippet uses the ace code editor which normally is loaded from a CDN. If you prefer your application to provide the editor locally, you can change the requirement from djangocms_snippet to djangocms_snippet[static-ace] and add djangocms_static_ace to your project's INSTALLED_APPS.

Configuration

To allow the contents of all snippets to be searchable, please set DJANGOCMS_SNIPPET_SEARCH to True in your settings:

DJANGOCMS_SNIPPET_SEARCH = True

We are using Ace as our editor of choice to edit the snippet content. You can customize the theme and mode through:

DJANGOCMS_SNIPPET_THEME = 'github'
DJANGOCMS_SNIPPET_MODE = 'html'

If dynamic content is inserted (for example {% show_menu ... %}), the plugin cache must be disabled, please set DJANGOCMS_SNIPPET_CACHE to False in your settings:

DJANGOCMS_SNIPPET_CACHE = False # default value is False

Template tag

You can also use a template tag to render a snippet rather than a plugin:

{% load snippet_tags %}
{% snippet_fragment [reference] %}

Replace [reference] with either:

  • The snippet ID, e.g. {% snippet_fragment 42 %}
  • The snippet slug, e.g. {% snippet_fragment 'my-snippet' %}
  • The snippet instance, e.g. {% snippet_fragment instance.snippet %}

Optionally provide a fallback if there is no matching id/slug/instance:

{% snippet_fragment 'my-snippet' or %}
    ... your content fallback here ...
{% endsnippet_fragment %}

Running Tests

You can run tests by executing:

virtualenv env
source env/bin/activate
pip install -r tests/requirements.txt
python setup.py test
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].