Skip to content

Commit 801e13f

Browse files
committed
alternative fix
1 parent 13d8739 commit 801e13f

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/Widget/Twig/TwigPreprocessor.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -348,18 +348,19 @@ public function preprocessEventDetail(Event $event, string $langcode, array $set
348348
$variables['language_switcher'][$langcodeItem] = '<a href="' . $url->__toString() . '">' . strtoupper($langcodeItem) . '</a>';
349349
}
350350

351-
$variables['show_share_links'] = true; //$this->disableSocialSharing ? false : $settings['share_buttons'];
352351
// Share links
353352
$shareUrl = Url::factory($this->socialHost . '/event/' . $event->getCdbid());
354353
$shareQuery = $shareUrl->getQuery();
355354
if (isset($_GET['origin'])) {
356355
$shareQuery['origin'] = $_GET['origin'];
357356
}
358357

359-
$variables['share_links'] = [
360-
'facebook' => 'https://www.facebook.com/sharer/sharer.php?u=' . urlencode($shareUrl->__toString()),
361-
'twitter' => 'https://twitter.com/intent/tweet?text=' . urlencode($shareUrl->__toString()),
362-
];
358+
if ($this->disableSocialSharing) {
359+
$variables['share_links'] = [
360+
'facebook' => 'https://www.facebook.com/sharer/sharer.php?u=' . urlencode($shareUrl->__toString()),
361+
'twitter' => 'https://twitter.com/intent/tweet?text=' . urlencode($shareUrl->__toString()),
362+
];
363+
}
363364
}
364365

365366
$variables['uitpas_promotions'] = '';

views/widgets/search-results-widget/detail-page.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@
293293

294294

295295

296-
{% if event.show_share_links and event.share_links %}
296+
{% if settings.share_buttons and event.share_links %}
297297
<dt>
298298
<em class="cnw_searchresult-detail-label">{{ 'event_detail_share'| transTo(preferredLanguage) }}</em>
299299
<i class="cnw-fa cnw-fa-share-alt"></i>

0 commit comments

Comments
 (0)