1

Is it possible to set: "show block on specific pages" into "is only the listed pages"?

I suppose that I should add a new item in this block info, but I don't know which one and can't find it in the api hook_block_info(); This block should be only visible in the page overview_courses/course but is visible in every page except overview_course/course

function menuNode_block_info() {
  $blocks['Course'] = array(
    'info' => t('Dit toont alle blocken weer'),
    'region' => 'sidebar_first',
    'weight' => 1,
    'status' => 1,
    'pages' => "overview_courses/course",
    'cache' => 'DRUPAL_NO_CACHE',
  );
  return $blocks;
}

Can someone help me? all help is welcome.

Kind regards

3

You need to set, visibility => 'BLOCK_VISIBILITY_LISTED'

function menuNode_block_info() {
  $blocks['Course'] = array(
    'info' => t('Dit toont alle blocken weer'),
    'region' => 'sidebar_first',
    'weight' => 1,
    'status' => 1,
    'visibility' => 'BLOCK_VISIBILITY_LISTED',
    'pages' => "overview_courses/course",
    'cache' => 'DRUPAL_NO_CACHE',
  );
  return $blocks;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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