Skip to content

Instantly share code, notes, and snippets.

@no-dashes
Last active August 29, 2015 13:57
Show Gist options
  • Save no-dashes/9739467 to your computer and use it in GitHub Desktop.
Save no-dashes/9739467 to your computer and use it in GitHub Desktop.
# Aus dem Controller kommen:
# - @employee
# - @context (alle infos, die Liquid benutzen soll/darf)
# - @template (Das Ding von oben)
- content_for :header do
= Liquid::Template.parse(@template.header).render(@context)
- content_for :submenu do
= Liquid::Template.parse(@template.submenu).render(@context)
# @employee-specific additions go here
= contentr_area :submenu
- content_for :right_col do
= Liquid::Template.parse(@template.right_col).render(@context)
# @employee-specific additions go here
= contentr_area :right_col
- content_for :main_content do
= yield
# @employee-specific additions go here
= contentr_area :main_content
= render layout: 'whatever-should-be-used-for-employees'
<!-- Bereichstemplate "Mitarbeiter" -->
Wert für "header":
<h1>{{ person.full_name }}</h1>
<span class="subhead">{% link person.faculty %}{{ person.faculty }}{% endlink %}</span>
Wert für "submenu"
{% submenu_link person %}{{ person.name }}{% endsubmenu_link %}
{% submenu_link person.publications %}Publikationen{% endsubmenu_link %}
{% submenu_link person.lectures %}Veranstaltungen{% endsubmenu_link %}
{% submenu_link 'http://youporn.com' %}Bilder und Videos{% endsubmenu_link %}
...
Wert für "right_col"
<!-- Inhaltsbaustein -->
{{% fixcontent bewerbung %}}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment