You are here

protected function SocialContentBlockLandingPageContentBuilder::getLink in Open Social 10.2.x

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_content_block/modules/social_content_block_landing_page/src/Service/SocialContentBlockLandingPageContentBuilder.php \Drupal\social_content_block_landing_page\Service\SocialContentBlockLandingPageContentBuilder::getLink()
  2. 10.3.x modules/social_features/social_content_block/modules/social_content_block_landing_page/src/Service/SocialContentBlockLandingPageContentBuilder.php \Drupal\social_content_block_landing_page\Service\SocialContentBlockLandingPageContentBuilder::getLink()
  3. 10.0.x modules/social_features/social_content_block/modules/social_content_block_landing_page/src/Service/SocialContentBlockLandingPageContentBuilder.php \Drupal\social_content_block_landing_page\Service\SocialContentBlockLandingPageContentBuilder::getLink()
  4. 10.1.x modules/social_features/social_content_block/modules/social_content_block_landing_page/src/Service/SocialContentBlockLandingPageContentBuilder.php \Drupal\social_content_block_landing_page\Service\SocialContentBlockLandingPageContentBuilder::getLink()

Function to generate the read more link.

Parameters

\Drupal\block_content\BlockContentInterface $block_content: The block content where we get the settings from.

Return value

array The read more link render array.

Overrides ContentBuilder::getLink

File

modules/social_features/social_content_block/modules/social_content_block_landing_page/src/Service/SocialContentBlockLandingPageContentBuilder.php, line 73

Class

SocialContentBlockLandingPageContentBuilder
Class SocialContentBlockLandingPageContentBuilder.

Namespace

Drupal\social_content_block_landing_page\Service

Code

protected function getLink(BlockContentInterface $block_content) : array {
  if ($link = parent::getLink($block_content)) {
    $link['#url']
      ->setOption('attributes', []);
    $link = [
      '#type' => 'container',
      '#attributes' => [
        'class' => [
          'card__link',
        ],
      ],
      'link' => $link,
    ];
  }
  return $link;
}