Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions administrator/components/com_newsfeeds/forms/newsfeed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,13 @@
size="20"
/>

<field
name="image_first_alt_empty"
type="checkbox"
label="COM_NEWSFEEDS_FIELD_IMAGE_ALT_EMPTY_LABEL"
description="COM_NEWSFEEDS_FIELD_IMAGE_ALT_EMPTY_DESC"
/>

<field
name="image_first_caption"
type="text"
Expand Down Expand Up @@ -302,6 +309,13 @@
size="20"
/>

<field
name="image_second_alt_empty"
type="checkbox"
label="COM_NEWSFEEDS_FIELD_IMAGE_ALT_EMPTY_LABEL"
description="COM_NEWSFEEDS_FIELD_IMAGE_ALT_EMPTY_DESC"
/>

<field
name="image_second_caption"
type="text"
Expand Down
4 changes: 3 additions & 1 deletion administrator/language/en-GB/com_newsfeeds.ini
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ COM_NEWSFEEDS_FIELD_CONFIG_NEWSFEED_SETTINGS_DESC="These settings apply for sing
COM_NEWSFEEDS_FIELD_CONFIG_NEWSFEED_SETTINGS_LABEL="News Feed"
COM_NEWSFEEDS_FIELD_FEED_DISPLAY_ORDER_LABEL="Feed Display Order"
COM_NEWSFEEDS_FIELD_FIRST_LABEL="First Image"
COM_NEWSFEEDS_FIELD_IMAGE_ALT_LABEL="Alt Text"
COM_NEWSFEEDS_FIELD_IMAGE_ALT_EMPTY_DESC="Decorative Image - no description required"
COM_NEWSFEEDS_FIELD_IMAGE_ALT_EMPTY_LABEL="No Description"
COM_NEWSFEEDS_FIELD_IMAGE_ALT_LABEL="Image Description (Alt Text)"
COM_NEWSFEEDS_FIELD_IMAGE_CAPTION_LABEL="Caption"
COM_NEWSFEEDS_FIELD_LINK_LABEL="Link"
COM_NEWSFEEDS_FIELD_NUM_ARTICLES_COLUMN_LABEL="# Articles"
Expand Down
11 changes: 9 additions & 2 deletions components/com_newsfeeds/tmpl/newsfeed/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,30 @@
<!-- Show Images from Component -->
<?php if (isset($images->image_first) && !empty($images->image_first)) : ?>
<?php $imgfloat = empty($images->float_first) ? $this->params->get('float_first') : $images->float_first; ?>
<?php $alt = empty($images->image_first_alt) && empty($images->image_first_alt_empty)
? ''
: 'alt="' . htmlspecialchars($images->image_first_alt, ENT_COMPAT, 'UTF-8') . '"'; ?>

<div class="com-newsfeeds-newsfeed__first-image img-intro-<?php echo htmlspecialchars($imgfloat, ENT_COMPAT, 'UTF-8'); ?>">
<img
<?php if ($images->image_first_caption) : ?>
<?php echo 'class="caption" title="' . htmlspecialchars($images->image_first_caption, ENT_COMPAT, 'UTF-8') . '"'; ?>
<?php endif; ?>
src="<?php echo htmlspecialchars($images->image_first, ENT_COMPAT, 'UTF-8'); ?>" alt="<?php echo htmlspecialchars($images->image_first_alt, ENT_COMPAT, 'UTF-8'); ?>">
src="<?php echo htmlspecialchars($images->image_first, ENT_COMPAT, 'UTF-8'); ?>" <?php echo $alt; ?>>
</div>
<?php endif; ?>

<?php if (isset($images->image_second) and !empty($images->image_second)) : ?>
<?php $imgfloat = empty($images->float_second) ? $this->params->get('float_second') : $images->float_second; ?>
<?php $alt = empty($images->image_second_alt) && empty($images->image_second_alt_empty)
? ''
: 'alt="' . htmlspecialchars($images->image_second_alt, ENT_COMPAT, 'UTF-8') . '"'; ?>
<div class="com-newsfeeds-newsfeed__second-image float-<?php echo htmlspecialchars($imgfloat, ENT_COMPAT, 'UTF-8'); ?> item-image">
<img
<?php if ($images->image_second_caption) : ?>
<?php echo 'class="caption" title="' . htmlspecialchars($images->image_second_caption) . '"'; ?>
<?php endif; ?>
src="<?php echo htmlspecialchars($images->image_second, ENT_COMPAT, 'UTF-8'); ?>" alt="<?php echo htmlspecialchars($images->image_second_alt, ENT_COMPAT, 'UTF-8'); ?>">
src="<?php echo htmlspecialchars($images->image_second, ENT_COMPAT, 'UTF-8'); ?>" <?php echo $alt; ?>>
</div>
<?php endif; ?>
<!-- Show Description from Component -->
Expand Down