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

Commit 8e88d10

Browse files
committed
Add support for custom sponsorship URL
Fixes #680 Signed-off-by: Matt Stratton <matt.stratton@gmail.com>
1 parent fa4f3cc commit 8e88d10

4 files changed

Lines changed: 37 additions & 24 deletions

File tree

REFERENCE.md

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,29 @@
33
# Table of contents
44
<!-- MDTOC maxdepth:6 firsth1:0 numbering:0 flatten:0 bullets:0 updateOnSave:1 -->
55

6-
[Fields in YYYY-CITY.yml](#fields-in-yyyy-cityyml)
7-
&emsp;[General Fields](#general-fields)
8-
&emsp;[Date-related Fields](#date-related-fields)
9-
&emsp;[Branding Fields](#branding-fields)
10-
&emsp;[Location Fields](#location-fields)
11-
&emsp;[Navigation Fields](#navigation-fields)
12-
&emsp;[Organizer Fields](#organizer-fields)
13-
&emsp;&emsp;[Team Members](#team-members)
14-
&emsp;&emsp;[Organizer Emails](#organizer-emails)
15-
&emsp;[Sponsor fields](#sponsor-fields)
16-
&emsp;&emsp;[Sponsor Levels](#sponsor-levels)
17-
&emsp;[Program Fields](#program-fields)
18-
&emsp;&emsp;[Program Items](#program-items)
19-
&emsp;&emsp;&emsp;[Program Element Colors](#program-element-colors)
20-
&emsp;&emsp;[Ignite Fields](#ignite-fields)
21-
[Pages and Frontmatter](#pages-and-frontmatter)
22-
&emsp;[General Page Fields](#general-page-fields)
23-
&emsp;[Talk Page Fields](#talk-page-fields)
24-
&emsp;[Speaker Page Fields](#speaker-page-fields)
25-
&emsp;[Program Page Fields](#program-page-fields)
26-
&emsp;[Blog Post Fields](#blog-post-fields)
27-
[Shortcodes](#shortcodes)
28-
&emsp;[google_form](#google_form)
6+
[Fields in YYYY-CITY.yml](#fields-in-yyyy-cityyml)
7+
&emsp;[General Fields](#general-fields)
8+
&emsp;[Date-related Fields](#date-related-fields)
9+
&emsp;[Branding Fields](#branding-fields)
10+
&emsp;[Location Fields](#location-fields)
11+
&emsp;[Navigation Fields](#navigation-fields)
12+
&emsp;[Organizer Fields](#organizer-fields)
13+
&emsp;&emsp;[Team Members](#team-members)
14+
&emsp;&emsp;[Organizer Emails](#organizer-emails)
15+
&emsp;[Sponsor fields](#sponsor-fields)
16+
&emsp;&emsp;[Sponsor Levels](#sponsor-levels)
17+
&emsp;[Program Fields](#program-fields)
18+
&emsp;&emsp;[Program Items](#program-items)
19+
&emsp;&emsp;&emsp;[Program Element Colors](#program-element-colors)
20+
&emsp;&emsp;[Ignite Fields](#ignite-fields)
21+
[Pages and Frontmatter](#pages-and-frontmatter)
22+
&emsp;[General Page Fields](#general-page-fields)
23+
&emsp;[Talk Page Fields](#talk-page-fields)
24+
&emsp;[Speaker Page Fields](#speaker-page-fields)
25+
&emsp;[Program Page Fields](#program-page-fields)
26+
&emsp;[Blog Post Fields](#blog-post-fields)
27+
[Shortcodes](#shortcodes)
28+
&emsp;[google_form](#google_form)
2929

3030
<!-- /MDTOC -->
3131

@@ -61,6 +61,7 @@ All dates are in unquoted YYYY-MM-DD, like this: `variable: 2016-01-05`, or like
6161
| `registration_date_end` | YYYY-MM-DD | No | The date you will close registration. Can be a blank value. | 2016-01-05 |
6262
| `registration_closed` | String | No | Set this to "true" if you need to manually close registration before your registration end date. | "true" |
6363
| `registration_link` | String | No | If you have a custom registration link, enter it here. This will control the Registration menu item as well as the "Register" button. | "https://myurlhere" | |
64+
| `sponsor_link` | String | No | If you have a custom sponsorship link, enter it here. This will control the Sponsor menu item as well as the "Become an X Sponsor!" links. | "https://myurlhere" | |
6465

6566
### Branding Fields
6667

exampleSite/data/events/2018-ponyville.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ registration_date_end: 2018-05-30
1414
registration_open: ""
1515
registration_closed: ""
1616
registration_link: "https://www.example.com"
17+
sponsor_link: "https://eventbrite.com"
1718
coordinates: "41.882219, -87.640530"
1819
location: "Applejack House"
1920
location_address: "350 West Mart Center Drive, Chicago, IL 60654"

layouts/partials/events/event_navbar.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@
2626
{{- $.Scratch.Set "url" $e.registration_link -}}
2727
{{- end -}}
2828
{{- end -}}
29+
{{- end -}}
30+
{{- if eq .name "sponsor" -}}
31+
{{- if $e.sponsor_link -}}
32+
{{- if ne $e.sponsor_link "" -}}
33+
{{- $.Scratch.Set "url" $e.sponsor_link -}}
34+
{{- end -}}
35+
{{- end -}}
2936
{{- end -}}
3037
<li class="nav-item active">
3138
<a class="nav-link" href="{{$.Scratch.Get "url" }}">{{ .name }}</a>

layouts/partials/sponsors.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ <h4 class="sponsor-cta">{{ $level.label }} Sponsors</h4>
2020
{{- if ( $e.startdate) or (ge (dateFormat "2006-01-02" $e.startdate) (dateFormat "2006-01-02" (dateFormat "2006-01-02" now))) -}}
2121
{{- if ne $e.sponsors_accepted "no" -}}
2222
{{- if or (not $level.max) (lt ($.Scratch.Get $level.id) $level.max) -}}
23-
<a href = "{{ (printf "events/%s/sponsor" $e.name) | absURL }}" class="sponsor-cta">
23+
{{- with $e.sponsor_link -}}
24+
<a href = "{{ . }}" class="sponsor-cta">
25+
{{- else -}}
26+
<a href = "{{ (printf "events/%s/sponsor" $e.name) | absURL }}" class="sponsor-cta">
27+
{{- end -}}
2428
<i>Become a {{ $level.label }} Sponsor!</i>
2529
</a>
2630
{{- end -}}

0 commit comments

Comments
 (0)