Skip to content
Snippets Groups Projects
Commit b1d698a4 authored by Tim Wagner's avatar Tim Wagner
Browse files

[TASK] Add option for showing/hiding video titles

parent 86f05027
No related branches found
No related tags found
1 merge request!3[FEATURE] UX Refactoring
......@@ -83,6 +83,7 @@ class YoutubeController extends ActionController {
'feed' => $jsonArray['items'],
'response' => $jsonArray,
'debugOutput' => $debugOutput,
'showTitle' => (int) ($this->settings['showTitle'] ?? 1),
'showDescription' => (int) ($this->settings['showDescription'] ?? 1),
]
);
......
......@@ -67,6 +67,7 @@ class PluginRenderer implements PageLayoutViewDrawItemHookInterface {
$templateData = [
'youtubeId' => $pluginConfiguration['settings.id']['vDEF'],
'maxResults' => $pluginConfiguration['settings.maxResults']['vDEF'],
'showTitle' => (int) ($pluginConfiguration['settings.showTitle']['vDEF'] ?? 1),
'showDescription' => (int) ($pluginConfiguration['settings.showDescription']['vDEF'] ?? 1),
'disableLightbox' => $pluginConfiguration['settings.disableLightbox']['vDEF'],
'disableLightboxMobile' => $pluginConfiguration['settings.disableLightboxMobile']['vDEF'],
......
......@@ -44,6 +44,17 @@
</TCEforms>
</settings.maxResults>
<settings.showTitle>
<TCEforms>
<exclude>0</exclude>
<label>LLL:EXT:sg_youtube/Resources/Private/Language/locallang.xlf:flexform.showTitle</label>
<config>
<type>check</type>
<default>1</default>
</config>
</TCEforms>
</settings.showTitle>
<settings.showDescription>
<TCEforms>
<exclude>0</exclude>
......
......@@ -53,6 +53,10 @@
<source><![CDATA[Show Video Descriptions]]></source>
<target><![CDATA[Videobeschreibungen anzeigen]]></target>
</trans-unit>
<trans-unit id="flexform.showTitle" approved="yes">
<source><![CDATA[Show Video Titles]]></source>
<target><![CDATA[Video-Titel anzeigen]]></target>
</trans-unit>
<trans-unit id="flexform.thumbnailImages" approved="yes">
<source><![CDATA[Custom Thumbnails for the Videos (The first image will be set on the first Youtube Video, then the second image one to the second video and so on...)]]></source>
<target><![CDATA[Benutzerdefinierte Thumbnails für die Videos (Das erste Bild wird auf das erste Youtube-Video gesetzt, dann das zweite Bild auf das zweite Video und so weiter...)]]></target>
......
......@@ -41,6 +41,9 @@
<trans-unit id="flexform.showDescription">
<source><![CDATA[Show Video Descriptions]]></source>
</trans-unit>
<trans-unit id="flexform.showTitle">
<source><![CDATA[Show Video Titles]]></source>
</trans-unit>
<trans-unit id="flexform.thumbnailImages">
<source><![CDATA[Custom Thumbnails for the Videos (The first image will be set on the first Youtube Video, then the second image one to the second video and so on...)]]></source>
</trans-unit>
......
......@@ -49,6 +49,15 @@
</td>
</tr>
<tr>
<th scope="row">
<f:translate key="flexform.showTitle" extensionName="SgYoutube"/>
</th>
<td>
<f:render partial="BooleanIcon" arguments="{boolValue: '{data.showTitle}'}"/>
</td>
</tr>
<tr>
<th scope="row">
<f:translate key="flexform.showDescription" extensionName="SgYoutube"/>
......
......@@ -43,7 +43,7 @@
<img src="{feed.0.thumbnail}" alt="{feed.0.title}"/>
</div>
</f:if>
<f:if condition="{feed.0.title}">
<f:if condition="{showTitle} && {feed.0.title}">
<div class="sg-youtube-title">
<h3 class="h3">
<f:format.htmlentitiesDecode>{feed.0.title}</f:format.htmlentitiesDecode>
......@@ -68,7 +68,7 @@
<img src="{feedItem.thumbnail}" alt="{feedItem.title}"/>
</div>
</f:if>
<f:if condition="{feedItem.title}">
<f:if condition="{showTitle} && {feedItem.title}">
<div class="sg-youtube-title">
<h3 class="h3">
<f:format.htmlentitiesDecode>{feedItem.title}</f:format.htmlentitiesDecode>
......@@ -94,7 +94,7 @@
<img src="{feedItem.thumbnail}" alt="{feedItem.title}"/>
</div>
</f:if>
<f:if condition="{feedItem.title}">
<f:if condition="{showTitle} && {feedItem.title}">
<div class="sg-youtube-title">
<h3 class="h3">
<f:format.htmlentitiesDecode>{feedItem.title}</f:format.htmlentitiesDecode>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment