1

How do I create and render a custom region in Drupal 7, when the Display Suite module is used? I am not able to show/display a block into a custom region and confused with the files structure. Please suggest any solution.

2 Answers 2

0

I got the solution and so sharing with all, if it could help someone:

Creating a custom region in our theme if we are using display suite module is slightly different.

1.First define region in your theme's .info file (same as we do without display suite)

regions[name_of_region] = 'Name of Region' 

2.Then print the following line in your template file wherever you want to display

print render(block_get_blocks_by_region('name_of_region'));
0

To create a custom region, I found I needed to add my region (called customregion) to the .module file:

$layouts['bootstrap_3_9'] = array(
  .......
  'regions' => array(
    'left' => t('Left'),
    'right' => t('Right'),
    'customregion' => t('Custom Region'),
  ),
  .......
);

and then just reference it in template:

<?php print $customregion; ?>

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.