Skip to content
This repository was archived by the owner on Jul 21, 2019. It is now read-only.

Commit 2406f69

Browse files
author
Christopher Mills
committed
Add barebones of tito shortcode logic
I want to be able to add a shortcode for tito and add specific named params in order to display the tito widget on a page I wish. I also want to allow use of releases and discount-codes The current naming convention is using underscores so lets do that! We'll also move to using external css and js, rather than keep them locally we don't want to add extra work always updating these. Signed-off-by: Chris Mills <me@christophermills.co.uk>
1 parent 0538b36 commit 2406f69

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

REFERENCE.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Reference for devopsdays-theme
2-
32
# Table of contents
43
<!-- MDTOC maxdepth:6 firsth1:0 numbering:0 flatten:0 bullets:0 updateOnSave:1 -->
54

@@ -307,3 +306,25 @@ This shortcode allows for the embedding of a Google form on a page, in a manner
307306
```
308307
{{< google_form "https://docs.google.com/forms/d/e/1FAIpQLScvv-ty_wEBlYkJaEC1OU0qqqbIHjf9JVa-Ptdo5TcHqz5EDA/viewform?usp=sf_link" >}}
309308
```
309+
310+
### tito_widget
311+
312+
Using the tito shortcode enables the embedding of the tito sales widget described on their documentation (https://ti.to/docs/widget). To use it you just need to enter to event path of your tito event which will follow the URL of your event page. For example, if the URL is `https://ti.to/devopsdays-london/2019` your event path would be `devlopsdays-london/2019`. The shortcode also enables the other features described such as the ability to show specific tickets using the examples shown below
313+
314+
```
315+
{{< tito_widget event="devopsdays-london/2019" >}}
316+
```
317+
318+
To show only a specific ticket within the widget:
319+
320+
```
321+
{{< tito_widget event="devopsdays-london/2019" releases="fiaurhghf2k">}}
322+
```
323+
324+
To show discounted tickets on the page (they display as a striked through full-price along with the new price):
325+
326+
```
327+
{{< tito_widget event="devopsdays-london/2019" discount-code="examplediscount" >}}
328+
```
329+
330+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<script src='https://js.tito.io/v1' async></script>
2+
<link rel="stylesheet" type="text/css" href='https://css.tito.io/v1.1' />
3+
<tito-widget event="{{ .Get "event" }}" {{ if (.Get "releases") }} releases="{{ with .Get "releases" }}{{.}}{{ end }}"{{ end }} {{ if (.Get "discount-code" )}} discount-code="{{ with .Get "discount-code" }}{{ . }}{{ end }}"{{ end }}></tito-widget>
4+

0 commit comments

Comments
 (0)