Includes

What are includes?

Includes are snippets of HTML that are used repeatedly across the website.

Since they can take variables, includes are excellent for snippits of HTML that should be consistently styles across the website while still having slightly different content.

Troop 370 uses multiple includes for the website, which enables easier editing of repeatable content.

Library of includes for Troop website

File downloads list

Use this include when listing files for download. This include allows you to display the file name, last edited date, file type, and file size.

Include

_includes/docs-table.html
{% if include.part == 'header' %}
<tr class="tmd-table-header_row">
  <th class="th-name">File name</th>
  <th class="th-date">Last updated</th>
  <th class="th-type">Type</th>
  <th class="th-size">Size</th>
</tr>
{% else %}{% endif %}

{% if include.part == 'row' %}
<tr class="tmd-table-row" onclick="window.location='{{ include.link }}'">
  <td>{{ include.name }}</td>
  <td>{{ include.date }}</td>
  <td>{{ include.type }}</td>
  <td>{{ include.size }}</td>
</tr>
{% else %}{% endif %}

Usage

circle-info

For each table, only include part="header" once.

part="row" is included once for each file.

Variable

Value

part

predefined: header, row

link

any URL

name

name of the file

date

last modified date of the file

type

file type (e.g. DOCX)

size

file size in MB or KB; size should not include more than six characters

Generated Example

Events page card

Creates a card for the sub-pages of/events/hub.html.

Include

Usage

Variable

Value

card-title

large title

card-subtitle

smaller subtitle text

card-href

URL to page when card is clicked

background-image

URL to card background image

Example

Generated card

Creates a carousel card for the main carousel on index.html. It should only be used as a child of div.main-carousel.

Include

Usage

Variable

Value

card-title

large title

card-subtitle

smaller subtitle text

card-href

URL to page when card button is clicked

button-text

text for card button

background-image

URL to card background image

Example

Generated card

Side navigation item (generated from collection)

See the collections page for information.

Collectionschevron-right

Include

Usage

Variable

Value

name

name of page

url

URL to page

Example

Generated link

Top navigation item

See the collections page for information.

Collectionschevron-right

Field items

Creates text fields, text areas, checkboxes, and radio inputs.

Include

Usage

Example

Last updated

Was this helpful?