Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logo image max height #2424

Merged
merged 3 commits into from Jan 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions engines/common/nucleus/particles/logo.html.twig
Expand Up @@ -5,14 +5,15 @@
{% if (url == gantry.siteUrl()) %}{% set rel='rel="home"' %}{% endif %}
{% set class=(particle.class ? 'class="'~ particle.class ~'"') %}
{% set image = url(particle.image) %}

{% set height = particle.height ? 'style="max-height: ' ~ particle.height ~ '"' %}

{% if particle.link == true %}
<a href="{{ url }}" target="{{ particle.target|default('_self') }}" title="{{ particle.text }}" {{ rel|default('')|raw }} {{ class|default('')|raw }}>
{% else %}<div {{ class|default('')|raw }}>{% endif %}
{% if particle.svg is not empty %}
{{ particle.svg|raw }}
{% elseif image %}
<img src="{{ url(particle.image) }}" alt="{{ particle.text }}" />
<img src="{{ url(particle.image) }}" {{ height|default('')|raw }} alt="{{ particle.text }}" />
{% else %}
{{ particle.text|default('Logo') }}
{% endif %}
Expand Down
8 changes: 7 additions & 1 deletion engines/common/nucleus/particles/logo.yaml
Expand Up @@ -35,7 +35,13 @@ form:
type: input.imagepicker
label: Image
description: Select desired logo image.


height:
type: input.text
label: Maximum Height
description: Set image max. height in rem, em, px, or percentage unit values
pattern: '\d+(\.\d+){0,1}(rem|em|ex|ch|vw|vh|vmin|vmax|%|px|cm|mm|in|pt|pc)'

link:
type: input.checkbox
label: Link
Expand Down