forked from nevercodealone/cms-symfony-sulu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add excert image as content element with alt text handling.
- Loading branch information
Showing
4 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
config/templates/includes/tailwind/blocks/excerpt-image.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<properties xmlns="http://schemas.sulu.io/template/template" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:xi="http://www.w3.org/2001/XInclude" | ||
xsi:schemaLocation="http://schemas.sulu.io/template/template http://schemas.sulu.io/template/template-1.0.xsd"> | ||
<block name="blocks" default-type="excerpt-image"> | ||
<!-- @see https://docs.sulu.io/en/2.1/reference/content-types/block.html --> | ||
<types> | ||
<type name="excerpt-image"> | ||
<meta> | ||
<title>Excerpt Image</title> | ||
</meta> | ||
<properties> | ||
<property name="headline" type="text_line"> | ||
<meta> | ||
<title>Überschrift</title> | ||
</meta> | ||
<params> | ||
<param name="headline" value="true"/> | ||
</params> | ||
</property> | ||
</properties> | ||
</type> | ||
</types> | ||
</block> | ||
</properties> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{% if extensionexcerpt.images[0] is defined and extensionexcerpt.images[0] is not empty %} | ||
{% set source = extensionexcerpt.images[0].thumbnails['content-full.webp'] %} | ||
{% set alt = extensionexcerpt.images[0].description %} | ||
<img class="h-auto max-w-full" src="{{ source }}" alt="{{ alt }}"> | ||
{% endif %} |