Skip to main content
6 of 6
added 8 characters in body
oknate
  • 14.5k
  • 4
  • 53
  • 98

you can use markup render arrays like this:

 public function build() {
    $build = [];

    $build['LinkA_url'] = ['#markup' => $this->configuration['LinkA_url']];
    $build['LinkB_url'] = ['#markup' => $this->configuration['LinkB_url']];
  
    return $build;
  }

Then in your twig:

  <p><a href="{{ content.LinkA_url }}">link 1</a></p>
  <p><a href="{{ content.LinkB_url }}">link 2</a></p>

then add hook_theme in your .module file:

/**
 * Implements hook_theme().
 */
function my_module_theme() {
  return array(
    'block__my_module' => array(
      'base hook' => 'block'
    ),
  );
}

Otherwise, it won't look in your module's templates folder.

oknate
  • 14.5k
  • 4
  • 53
  • 98