Skip to content

Instantly share code, notes, and snippets.

@loweoj
Last active June 16, 2017 11:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loweoj/73a8608bbd1cf144c3822320ec857449 to your computer and use it in GitHub Desktop.
Save loweoj/73a8608bbd1cf144c3822320ec857449 to your computer and use it in GitHub Desktop.
course.php
perch_template('content/courses/course.html', $Course);
perch/content/courses/course.html
<!--* Shared scehma between event and course *-->
<perch:template path="shared/event-course-schema.html" />
<!--* Event-specific schema. Order attributes added to order these after the main title/subtitle/slug *-->
<perch:content id="courseStartDate" type="date" label="Start date" suppress="true" order="4" />
<perch:content id="courseEndDate" type="date" label="End date" help="" suppress="true" order="5" />
<perch:repeater id="sessions" label="Sessions" max="15" scope-parent="true">
<perch:content id="sessionDate" type="date" label="Date" format="j M y" suppress="true" />
<perch:content id="sessionTitle" type="text" label="Session Title" suppress="true" />
</perch:repeater>
<!--*
Start Template Output
*-->
<perch:template path="shared/event-course-layout.html" />
perch/templates/shared/event-course-schema.html
<!--*
Define the fields here, so they are properly ordered in the admin
interface, without having resort to order=... madness
*-->
<perch:content id="title" title="true" label="Title" type="smarttext" required="true" suppress="true" order="1" />
<perch:content id="subTitle" type="smarttext" label="Subtitle" help="This will appear inside the main title but smaller" suppress="true" order="2" />
... more fields ...
perch/templates/shared/event-course-layout.html
<!--*
Shared layout between a course and an event.
*-->
... lots of html layout stuff ... then:
<!--* ##### This isn't working ##### *-->
<perch:template path="partials/_event-date.html" />
perch/templates/partials/_event-date.html
... event date stuff ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment