{%- comment -%} Inserts a full data set of an campus of an organization. The data will be formatted as postal address, followed by an external link to the organizations website. On error, a placeholder will be inserted to prevent messing up the formatting of pages that expect a block at this position. The parameter "campus" is expected to be a key into _data/helmholtz-centers.yml ! See also the documentation there for field-specific behaviour. ! If the key is not valid, an informative HTML comment will be inserted. If available, the parameter "room" will be inserted verbatim at the appropriate position. {%- endcomment -%} {%- if include.location -%} {%- assign campus-id = include.location.campus -%} {%- assign room = include.location.room -%} {%- if campus-id -%} {%- assign organization-code = campus-id | split: "-" | first -%} {%- assign organization = site.data.helmholtz-centers[organization-code] -%} {%- assign location = organization.campii[campus-id] -%} {%- if organization and location -%}
{{ organization.name }} Campus {%- if location.name -%} {{ location.name }} {%- else -%} {{ location.city }} {%- endif -%} {%- if room -%} {{ room }} {%- endif -%} {{ location.street }} {{ location.zip-code }} {{ location.city }} {%- if location.country -%} {{ location.country }} {%- else -%} Germany {%- endif -%}
{%- if location.website -%} {%- assign website = location.website -%} {%- else -%} {%- if organization.website -%} {%- assign website = organization.website -%} {%- endif -%} {%- endif -%} {%- if website -%} {{ website | split: "/" | first }} {%- endif -%} {%- comment -%} Space for map button here {%- endcomment -%}
{%- else -%}
{{ campus-id }} {%- if room -%} {{ room }} {%- endif -%}
{%- endif -%} {%- else -%}
{{ include.location }}
{%- endif -%} {%- else -%}
{%- endif -%}