Skip to main content

Custom landingpages for pretix organizers

Project description

Everything you need to know

CI

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

  1. Enable the admin mode and go to the global settings.
  1. 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.

  1. activate your local pretix environment.
  2. cd into pretix-landing-pages
  3. run python setup.py develop to package the plugin
  4. cd into your pretix source code (pretix/src)
  5. run python manage.py makemigrations pretix_landing_pages to create the migrations
  6. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pretix-landing-pages-0.9.1.tar.gz (22.4 kB view hashes)

Uploaded Source

Built Distribution

pretix_landing_pages-0.9.1-py3-none-any.whl (27.3 kB view hashes)

Uploaded Python 3

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