Package: emencia-django-slideshows
IntroductionYou can havemultiple Slideshowsand each of themhave their own slides. Slides can be ordered and they contains a title, an optional content text, an optional URL and an optional image.Slideshows can use custom templates and custom config templates. Config templates are used to contains some Javascript to configure/initialize your slideshow with your slider library. But by default a Slideshow item have no config template, this is optional.It does not contains any assets to integrate it in your site, this is at your responsability to integrate it (choose and install your slider library, add your assets where you need, customize the template, etc..).LinksDownload hisPyPi package;Clone it on hisGithub repository;RequireDjango >= 1.8;django-filebrowser-no-grappelli>= 3.5.6;Optionaldjangocms_text_ckeditor>= 2.4.0 ORdjango-ckeditor>= 4.4.4 (seeCkeditorsection);CkeditorA Ckeditor django app can be installed to use it for theSlide.contentmodel attribute instead of the simpleTextField.Soit is at your responsabilityto manualy install (with pip, buildout, etc..) one of them if you need it. Once it’s installed, you won’t need to worry about this again.Note that the default assumed app isdjangocms_text_ckeditorand if not installed,django-ckeditorwill be assumed. If you have installed both,djangocms_text_ckeditorwill be used. If none of them is installed, the default Django fieldTextFieldwill be used.Choosing what app to install depends mostly from if you have allready installed DjangoCMS or not. If you have, you probably allready have its ckeditor app installed, so no need to install the other app because. If you don’t have installed DjangoCMS, just installdjango-ckeditor.Finally you can add custom settings for CKeditor, see its documentation to see how to set them (you may have to go to official CKeditor documentation to know about available settings).InstallAdd it to your installed apps in the settings :INSTALLED_APPS = (
    ...
    'slideshows',
    'filebrowser',
    ...
)If you have installed one of the django app for CKeditor, add it also to yoursettings.INSTALLED_APPS.Then add its settings :from porticus.settings import *See the appsettings.pyfile to see what settings you can override.Also there is some settings you may see aboutdjango-filebrowser-no-grappelli(see its documentation for more details).And add its views to your mainurls.py:from django.conf.urls import url, patterns
from filebrowser.sites import site as filebrowser_site

urlpatterns = patterns('',
    ...
    url(r'^slideshows/', include('slideshows.urls', namespace='slideshows')),
    url(r'^admin/filebrowser/', include(filebrowser_site.urls)),
    ...
)Finally install app models in your database using Django migrations:python manage.py migrateUsageThe process to build the HTML will be to generate the optional config HTML if any, then generate the content HTML.The common way is to display a Slideshow with all slides, this is called theSlides show. And there is another mode calledRandom slidewhich only display a single slide taked randomly from a Slideshow published slides.With the template tagCreate your slideshow from the admin, feed it with some slides, then use it in your templates :{% load slideshows_tags %}
...
{% slideshow_render 'your-slug' %}The first argument accept either a slug string or a Slideshow instance.Also you can override the content template and the config template saved within the template tag :{% load slideshows_tags %}
...
{% slideshow_render 'your-slug' 'slideshows/slides_show/custom.html' 'slideshows/slides_show/configs/custom.html' %}(Use'None'as the second argument if you just want to override the config template).Note that if the given Slideshow slug does not exist, this will raise a Http404.With the viewsViews use the defined template in Slideshow instance, there is no particular process to define.You can reach a slideshow view with an url like/slideshows/show_slides/SLUG/whereSLUGis the defined slug on the Slideshow object;You can reach the random image mode for a slideshow view with an url like/slideshows/random_slide/SLUG/whereSLUGis the defined slug on the Slideshow object;Within DjangoCMS pagesYou can install an additional package to use your slideshows in pages placeholder contents. Seecmsplugin-slideshows.TemplatesSlideshow content templates will have the following context variables :slideshow_js_config: the generated config template if any, else an empty string;slideshow_instance: the Slideshow model instance;slideshow_slides: a queryset of published slides for the Slideshow instance;Slideshow config templates will have the following context variables :slideshow_instance: the Slideshow model instance;slideshow_slides: a queryset of published slides for the Slideshow instance;This is available for the template tag and also the cms plugin.