Skip to content

Instantly share code, notes, and snippets.

@iso100
Created December 12, 2013 22:00
Show Gist options
  • Select an option

  • Save iso100/7936342 to your computer and use it in GitHub Desktop.

Select an option

Save iso100/7936342 to your computer and use it in GitHub Desktop.

Revisions

  1. iso100 created this gist Dec 12, 2013.
    49 changes: 49 additions & 0 deletions Statamic_related_content.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,49 @@
    quote.yaml

    ~~~

    fields:
    quote_body:
    type: redactor
    display: Quote Body
    required: true
    quote_cite:
    type: text
    display: Citation
    content:
    type: hidden

    ~~~

    Relevant section of page.yaml where quotes are referenced:

    ~~~
    quote:
    display: Related Quote
    type: suggest
    instructions: Select a quote to assign to this page.
    max_items: 1
    allow_blank: true
    placeholder: "Choose a quote..."
    content:
    folder: quotes
    label: title
    value: url
    type: entries
    ~~~

    Template code for rendering the quote:

    ~~~
    {{ if quote }}
    {{ get_content from="{ quote }" }}
    <div class="portlet quote-content">
    <h3>Quotes</h3>
    <blockquote>
    {{ quote_body }}
    <cite>{{ quote_cite }}</cite>
    </blockquote>
    </div>
    {{ /get_content }}
    {{ endif }}
    ~~~