Skip to main content
deleted 113 characters in body
Source Link
4uk4
  • 101.7k
  • 7
  • 173
  • 217

To get the same variables as a block template add it as base hook to the theme hook and to be sure you can define the render element again (though it should work without this):

/**
 * Implements hook_theme().
 */
function mymodule_theme() {
  return [
    'block__views_block__MYVIEW_block_1' => [
      'render element' => 'elements',
      'base hook' => 'block',
    ],
  ];
}

Now you can place the twig template in mymodule/templates/, the path and filename isare discovered automatically.

To get the same variables as a block template add it as base hook to the theme hook and to be sure you can define the render element again (though it should work without this):

/**
 * Implements hook_theme().
 */
function mymodule_theme() {
  return [
    'block__views_block__MYVIEW_block_1' => [
      'render element' => 'elements',
      'base hook' => 'block',
    ],
  ];
}

Now you can place the twig template in mymodule/templates/, the path and filename is discovered automatically.

To get the same variables as a block template add it as base hook:

/**
 * Implements hook_theme().
 */
function mymodule_theme() {
  return [
    'block__views_block__MYVIEW_block_1' => [
      'render element' => 'elements',
      'base hook' => 'block',
    ],
  ];
}

Now you can place the twig template in mymodule/templates/, path and filename are discovered automatically.

added 106 characters in body
Source Link
4uk4
  • 101.7k
  • 7
  • 173
  • 217

To get the same variables as a block template add it as base hook to the theme hook and to be sure you can define the render element again (though it should work without this):

/**
 * Implements hook_theme().
 */
function mymodule_theme() {
  return [
    'block__views_block__MYVIEW_block_1' => [
      'render element' => 'elements',
      'base hook' => 'block',
    ],
  ];
}

Now you can place the twig template in mymodule/templates/, the path and filename is discovered automatically.

To get the same variables as a block template add it as base hook to the theme hook and to be sure you can define the render element again (though it should work without this):

/**
 * Implements hook_theme().
 */
function mymodule_theme() {
  return [
    'block__views_block__MYVIEW_block_1' => [
      'render element' => 'elements',
      'base hook' => 'block',
    ],
  ];
}

To get the same variables as a block template add it as base hook to the theme hook and to be sure you can define the render element again (though it should work without this):

/**
 * Implements hook_theme().
 */
function mymodule_theme() {
  return [
    'block__views_block__MYVIEW_block_1' => [
      'render element' => 'elements',
      'base hook' => 'block',
    ],
  ];
}

Now you can place the twig template in mymodule/templates/, the path and filename is discovered automatically.

Source Link
4uk4
  • 101.7k
  • 7
  • 173
  • 217

To get the same variables as a block template add it as base hook to the theme hook and to be sure you can define the render element again (though it should work without this):

/**
 * Implements hook_theme().
 */
function mymodule_theme() {
  return [
    'block__views_block__MYVIEW_block_1' => [
      'render element' => 'elements',
      'base hook' => 'block',
    ],
  ];
}