0

The below implementation of hook_block_info renders a block in the 'content' region of my theme. Unfortunately, it also appears in the content region of the administrative theme. The documentation states:

properties: (optional) Array of additional metadata to add to the block. Common properties include: administrative:

Boolean that categorizes this block as usable in an administrative context. This might include blocks that help an administrator approve/deny comments, or view recently created user accounts.

/**
 * Implements hook_block_info().
 */
function mymodule_block_info() {
  $blocks['diary'] = array(
    'info' => t('Diary'),
    'properties' => array('administrative' => FALSE),
    'weight' => 1,
    'status' => TRUE,
    'region' => 'content',
  );
  return $blocks;
}

However, my block is still appearing in the 'content' region of the administrative theme?

1 Answer 1

0

According to this comment, you can also specify the theme. I haven't tried it -- let us know if it works!

There's also a theme key-value pair:

'exposed_order' => array(
'info' => t('Exposed commerce order filter'),
'theme' => $admin_theme,
'region' => 'content',
'pages' => ORDER_MENU_LINK,
'status' => 1,
'visibility' => 1,
),
4
  • Thanks. I've considered this, but I would have to specify just my current theme, which means if I switch themes the problem would return.
    – dbj44
    Commented Nov 7, 2014 at 16:26
  • Can you go into the block configuration and just turn it off for the administrative theme in the settings page?
    – Laryn
    Commented Nov 7, 2014 at 16:33
  • Sure, there are lots of workarounds, but I want to know how the properties attributes work.
    – dbj44
    Commented Nov 7, 2014 at 19:07
  • No problem -- I suggested a slight edit to your question to clarify that you are mainly interested in further info about the properties attribute.
    – Laryn
    Commented Nov 7, 2014 at 20:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.