Custom landingpages for pretix organizers
Project description
Everything you need to know
This plugin allows you to upload custom pages using the Django template language (and extra files like stylesheets etc.) for the Pretix starting page or individual organizer pages.
Getting started in Pretix Pretix Userguide
Table of contents
1. Usage
1.1. Roles and Rights
Pretix offers different roles with different corresponding rights, the relevant roles for this plugin are listed below.
User
The basic role for logged in accounts. Cannot change any settings.
Organizer
Can change organisation specific settings like Landingpage-Settings or Team Assignment Rules.
Admin with enabled Admin mode
Can change global settings for the pretix instance like the startingpage settings or he can enable the landingpage plugin for a certain organisation. To access these functionalities you have to be in Admin mode, which is only accessable for admins.
How to enable the admin mode :
1.2. Starting Page
The following options are available for the starting page:
- Upload and set up a custom starting page (named
index.html
) - Upload and use additional files in the
index.html
- Set up a redirect to another website
You need to be logged in as an admin and have the admin mode activated.
To configure the starting page go to the corresponding settings page in the global settings dropdown menu.
You will land on the following page, where you can then configure said things.
For the HTML you can use the load_path tag to embed additional files
Note: It is not possible to activate the custom starting page and a redirect at the same time.
1.3. Landing Page for Organizers
To upload an organizer specific landingpage, go to your organizer's control page.
Then select the navigation item Landingpage
.
You can now upload your index.html
and additional files. To make your custom landingpage visible select the Use custom landing page
button.
You will land on the following page.
Example for a landingpage:
{% load load_path %}
<html>
<head>
<link rel="stylesheet" type="text/css" href={% load_path "style.css" %}>
</head>
{% block page %}
{% include 'pretixplugins/pretix_landing_pages/calendar.html' %}
{% endblock %}
{% include "pretixplugins/pretix_landing_pages/event_list.html" with events=upcoming_events %}
<body>
<img src={% load_path "image.png" %}>
</body>
</html>
1.4. Additional Files
You can use the template tag load_path
to get the path of any of your additional uploaded files (except index.html
).
Remember to put {% load load_path %}
at the start of your HTML to load the template tag. This template tag loads the path to user uploaded files, so you only have to know the filename.
If the path loading failes, e.g. because of a missing file, the file will not be available for the website it should be embedded in, but everything else will work fine.
Example for usage of load path:
{% load load_path %}
<html>
<body>
<img src={% load_path "image.png" %}>
</body>
</html>
Note: You can only reference uploads of your current organizer or the starting page respectively.
1.5. Event List for Organizer
To include upcoming events as a table in your custom landing page, simply add
{% include "pretixplugins/pretix_landing_pages/event_list.html" with events=upcoming_events %}
at the desired place.
Alternatively, you can put previous_events
instead of upcoming_events
to display events that have already finished.
<html>
Your Html Code
{% include "pretixplugins/pretix_landing_pages/event_list.html" with events=upcoming_events %}
</html>
Note: If you are not using the default Pretix style, you might want to add table-styling.
1.6. Calendar for Organizer
To include a calendar that includes your events as objects, simply add
{% include "pretixplugins/pretix_landing_pages/calendar.html" %}
at the desired place.
We recommend that if you want to use this, make your html
extend the pretix-default template,
as styling is not straight forward:
{% extends "pretixpresale/base.html" %}
{% block thetitle %}
Some fancy page title
{% endblock %}
{% block page %}
{% include 'pretixplugins/pretix_landing_pages/calendar.html' %}
{% endblock %}
2. Administration
2.1. Installation
Please reference the corresponding Pretix documentation for small-scale manual deployment or small-scale deployment with docker.
There is an example Dockerfile provided in this project's repository.
2.2. Plugin Activation
This plugin is enabled by default. Admins can, however, enable this plugin individually for each organizer. To do so
- Enable the admin mode and go to the global settings.
- Select the organizers you want to allow to use the plugin.
There is also an option to enable the plugin for all organizers. (default)
If an organizer is not selected he is not allowed to use the plugins functionalities.
Note: Only enable this plugin for organizers you trust! Uploading custom pages can result in serious security issues as organizers can put anything they want on their page.
3. Development Setup
Pretix needs to be installed.
Clone this repository to any directory on your system.
- activate your local pretix environment.
- cd into pretix-landing-pages
- run
python setup.py develop
to package the plugin - cd into your pretix source code (
pretix/src
) - run
python manage.py makemigrations pretix_landing_pages
to create the migrations - run
python -m pretix migrate
to migrate DB-model changes into pretix-DB
Once the setup is done, there is no need for actions after changes to the plugin, unless you make changes to the DB model
=> In this case, you need to rerun step 6. (to 8)
4. Terminology
Landingpage
Site used by the organizer to represent an organization
Startingpage
The root page of a pretix instance (can only be changed by the admin in admin mode)
Here are some other Pretix-Terminology
5. License
Copyright 2019 - 2020, Benjamin Hättasch and TU Darmstadt Bachelorpraktikum 2019/2020 Group 45
Released under the terms of the Apache License 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pretix-landing-pages-0.9.1.tar.gz
.
File metadata
- Download URL: pretix-landing-pages-0.9.1.tar.gz
- Upload date:
- Size: 22.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
b9d30b8a32f2f957651f1ae0c9d1f9abedd6447432669140605499d2de89c5f2
|
|
MD5 |
3feb0ad6021f0b83ae09d03fe47d3978
|
|
BLAKE2b-256 |
853885fb0b2cfd2f2d85ff22c07d4d230bdd57ef30710fb8739d4123db63775b
|
File details
Details for the file pretix_landing_pages-0.9.1-py3-none-any.whl
.
File metadata
- Download URL: pretix_landing_pages-0.9.1-py3-none-any.whl
- Upload date:
- Size: 27.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
6c6ce24a12e2e6d3506cba68a0d5a481c4b21e95e8f315bce26eafb3faeec843
|
|
MD5 |
66c6232db77b4f972abe8501c065b829
|
|
BLAKE2b-256 |
4927a059643a280832e3593728efac7cb83494312b339078415282f6ce37e9d8
|