https://github.com/dathere/ckanext-heroslideradmin
https://github.com/dathere/ckanext-heroslideradmin
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dathere/ckanext-heroslideradmin
- Owner: dathere
- License: mit
- Created: 2023-11-15T19:46:13.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-12T15:10:32.000Z (over 1 year ago)
- Last Synced: 2025-06-22T20:43:48.271Z (10 months ago)
- Language: Python
- Size: 864 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ckanext-heroslideradmin
Adds a hero slider to the homepage which can be managed from the sysadmin panel.
-------------------
Functionality
-------------------
The end user can either upload their own images or link them as hero sliders on the homepage. The system administrator can add/remove images in the `sytemadmin settings` -> `Hero Slider Config` where is possible to manage hero slided.
The following image shows how the user interface looks like.

The updated images are going to be displayed in the main page. The following images shows the example of the main page.

------------------------
Development Installation
------------------------
To install ckanext-heroslideradmin for development, activate your CKAN virtualenv and
do::
git clone https://github.com/OpenGov-OpenData/ckanext-heroslideradmin.git
cd ckanext-heroslideradmin
python setup.py develop
pip install -r dev-requirements.txt
Add heroslideradmin to the ckan.plugins setting in your CKAN config file (by default the config file is located at /etc/ckan/default/production.ini)::
ckan.plugins = heroslideradmin
---------------
Config Settings
---------------
Run the following command to create the necessary tables in the database (ensuring the pyenv is activated)
ON CKAN >= 2.9::
(pyenv) $ ckan --config=/etc/ckan/default/production.ini heroslideradmin initdb
ON CKAN <= 2.8::
(pyenv) $ paster --plugin=ckanext-heroslideradmin heroslideradmin initdb --config=/etc/ckan/default/production.ini
Finally, restart CKAN to have the changes take affect::
sudo service apache2 restart
-------------------
Hero Slider Snippet
-------------------
To add the hero slider to the homepage, add the following block to the appropriate homepage template (eg: ckanext-example_plugin/ckanext/example_plugin/templates/home/layout3.html):
{% if 'heroslideradmin' in g.plugins %}
{% snippet 'home/snippets/hero_slider.html' %}
{% endif %}