Questions tagged [regions]

In a Drupal theme, the places where blocks can be put are called regions.

Filter by
Sorted by
Tagged with
0
votes
1answer
457 views

How do I override the content region for a specific page?

I want to override the content region for a specific page, but using the hook page--mypage--region--content.tpl.php won't work. How should I name it? My site supports block override, I tested this ...
0
votes
1answer
471 views

Content region not visible in blocks setup page in Sky Adaptive Theme

I checked the 'content' region, being one of the prerequisite regions and it is present and referenced in the sky.info file as well as in the page.tpl.php. That is: (in sky.info file) regions[...
0
votes
2answers
738 views

Rendering a region in region--footer.tpl.php

I have my social media links in my sidebar_first region. And these social icons are included in my footer. So in region--footer.tpl.php, I have rendered sidebar_first region but it is not displaying, ...
1
vote
1answer
974 views

Regions do not display in “Demonstrate block regions”

I wonder why some regions of my theme don't display in section 'Demonstrate block rerions'. This happens with some themes which I downloaded from Drupal.org, for example with the Software theme. Here ...
0
votes
2answers
593 views

How to make a custom block listen to context module?

I've been creating my own module that consist an array of blocks. I plan to print them using context as oppose programatically as I already have the module on use (no need to reinvent the wheel). ...
0
votes
2answers
722 views

Content Region Not Displaying

I'm relatively new to Drupal and am just squashing bugs on my first site. I have a region that I declared in my theme.info file: regions[alert] = 'Sitewide Alert' and I have a block that has a ...
0
votes
1answer
377 views

Moving elements to other page regions

I want to move the page breadcrumb to the content region in Bartik (D7.) I assume it is theming but I can't find anywhere (style.css, layout.css) where the breadcrumb is assigned in the first place. ...
0
votes
2answers
444 views

How to let a user switch between blocks that need to be shown?

I have pre-defined blocks A,B and C that are meant to be placed in the sidebar_first region. What I would like to achieve is: a visitor could select the block that needs to be displayed for the ...
4
votes
1answer
2k views

how to check messages exists

I want to check is there any messages in my template in drupal 7 there was a global variable in page template variables messages now in drupal 8 I want to check is there any message but messages ...
1
vote
1answer
559 views

How to render only markup in region template?

I have created a region--footer.html.twig template which only contains the static markup for the footer. Now I would like to render this region at the bottom of each page so I have added the following ...
0
votes
0answers
34 views

How selectively print the content of region.html.twig

I'm trying to modify the html of region.html.twig I've used a hook to override the suggestion: function my_theme_theme_suggestions_region_alter(array &$suggestions, array $variables) { if($...
1
vote
1answer
4k views

How do I add a custom region?

How do I add a custom region in the bootstrap theme using Drupal 8? I have installed a Bootstrap theme and now I want to add a custom region before the Header region. What should I add in the theme ....
0
votes
0answers
13 views

Add row after amount of blocks

I'm trying to archieve something that looks very easy for me, but I can't find the solution. I'm using drupal 9, bootstrap 3 subtheme. I have a region (region-buttons) that has multiple blocks. {% ...
2
votes
2answers
142 views

Can a block span more than one region in a theme?

Can a block span more than one region in a theme? Sometimes I would like content to do this, depending on the page. I'm aware (and heavily use) Panels which are great but I thought it would be worth ...
2
votes
2answers
749 views

How to make a theme hook suggestion for menu according to region?

I'm placing the same menu block in two different regions whereas different html markup for the list is needed. So analog to my previous question "How to make a theme hook suggestion for blocks ...
0
votes
1answer
200 views

Template preview not working properly

I've got a huge problem with my template preview. For all of my post (page, article and so on), I have not the good region in my page. My theme is extended Classy. If I go to see the page (not ...
0
votes
0answers
46 views

Add a region to the page--front.html.twig

I've created a few new region in my yml regions: header: "Header" jumbotron: "Jumbotron" chiffres: "Chiffres" steps: "Etapes" presentation: "Presentation des formules" ...
0
votes
0answers
56 views

How am I meant to display different elements on different pages?

I'm coming to Drupal from more conventional MVC frameworks (Laravel, CakePHP, etc.) In those frameworks, if I want a specific element (say, a form) to appear only on specific pages, then I basically ...
2
votes
3answers
628 views

Hide a region with empty view in it

I have a region page_intro where I display a view, with some CSS on it. When the view is empty (return no result), the region is still displayed (All html code before and after {{ page.page_intro }}). ...
6
votes
2answers
4k views

Moving Exposed Views Filter into another region of the page

Is there any way to move the exposed filters of views into another region of the site? i.e. I want to have a Search functionality attached to the a view by exposing the "Search: Search Terms", but I ...
9
votes
2answers
2k views

How to assign blocks to particular regions on theme install?

Drupal 8 provides some blocks by default. Eg. Site Branding, Main Navigation, Powered by Drupal, Search etc. I have created a theme that has Site branding & Main Navigation named regions in which ...
3
votes
3answers
1k views

How do i get the all the regions available in the current theme programatically?

I want the list of the names of all regions available in the current theme in drupal 8. How to do this ? And is it possible to get the list of the blocks placed on that region ?
0
votes
0answers
31 views

I accidentally removed the core blocks from content region

I accidentally remove the core/system blocks that normally sit under the content region and now I am not able to access any of the administration page. If I visit my site/user/login, or register, etc,...
1
vote
1answer
328 views

How to hide empty 'Content Zone' div in Omega?

I'm using Omega and I have "Force this zone to be rendered" unchecked in the Content Zone settings, and "Force this region to be rendered" unchecked in the Regions settings. Any idea what would force ...
4
votes
4answers
3k views

Hide region when block menu is empty

I got the 2nd level main menu in a block in the sidebar, drupal 8 correctly hides the menu (and the block) when the user browses a page that is not in this menu, but the theme continues to show the ...
0
votes
1answer
29 views

Place a custom block inside admin area

How is it possible to place a custom block inside the admin area? (e.g. in a node edit form)? I tried with page restriction but with no success. How can I see the block regions of the admin theme (...
3
votes
2answers
816 views

How to avoid no-wrapper tags on regions?

How do I make sure ALL regions are wrapped according region.tpl.php? In a subtheme of Zen I have created my own regions and modified the page.tpl.php file to something like the following: <div #...
-1
votes
2answers
406 views

How to print a custom region in a custom module's template?

I want to define a region, but the problem is that for different pages, the position of the region would be slightly different. So I can not put the region in page.tpl.php and for different custom ...
1
vote
1answer
407 views

Can't add block in a region

I'm using a Drupal 7 version website and I'm trying to add a block to a region, when I go in blocks and try to add the block to the region and I do save it reply me that it has been saved but no block ...
1
vote
0answers
104 views

Need to display Views block in between two fields of a node [closed]

I have dynamic view block that i need to display between "body" and "last updated" fields of a Basic page node. (i.e. "last updated" field has to be at the bottom of a page).
1
vote
3answers
525 views

Region on specific page

Is it possible to set a region on a specific page? I've created a page and I only want it to display it there and not elsewhere.
0
votes
1answer
30 views

Putting footer region under body tag

I'm fairly new to drupal and this is my first time posting on stackexchange. Constructive critisism and feedback are more than welcome. All regions in my custom theme are placed inside the body tag ...
1
vote
0answers
386 views

Trouble Hiding Regions When Blocks Are Empty

Having trouble seeing why my regions render when I think they shouldn't... page.html.twig: {% if page.region %} {{ page.region }} {% endif %} region.html.twig: {% if content %} <div id="" ...
1
vote
3answers
4k views

How do I add 2 blocks side-by-side in Bootstrap theme's “Content” region?

I have block views on the first page in the "Content" region of the Bootstrap theme that I would like to display as follows: _________________ | | | another block | |...
4
votes
3answers
5k views

Adding a class to a region

I am working on my theme in Drupal 8 and I want to add a class to my header div. I tried adding this to the region.vars.php file. if ($region === 'header') { $variables[header]['class'][] = '...
0
votes
0answers
17 views

When is region.tpl.php used?

I've got a Drupal 7 site, and I'm working with regions. It seems that no matter what theme I use, /modules/system/region.tpl.php will never be used / applied. It seems that any hook_preprocess_region ...
0
votes
1answer
252 views

How to split region block render?

Is it possible to split the rendering of the blocks in a region ? I have see this question Drupal 8 - How to split display the blocks separately in region.html.twig attempting to solve this by using ...
3
votes
1answer
660 views

How do I display two blocks separately?

In my header region, I have two blocks: menu and search. I want to add some other HTML between them. I tried using {{ content.menu}}, but it doesn't actually do return anything. I can split up the ...
0
votes
2answers
176 views

Custom block assigned to new region invalid

I had created a new region to my theme "buynow" and my theme.info contains the following line regions[buynow] = Buynow In my custom module i had created a custom block in which i assigned the block ...
2
votes
1answer
1k views

Hide block if content is empty not working

I want to hide an entiere block is it has not result. I went into my view, then I add "Contextual filter", "Empty", "Hide view". But my view is always hidden if I do this, and I don't understand ...
3
votes
2answers
1k views

Re-creating complex CSS footer layout in Drupal

I've been given some HTML & CSS files by our university web designer and need to replicate essentially the same layout into the library website I'm creating in Drupal. The footer (pleased see ...
0
votes
3answers
1k views

front page isn't referring to front--page.tpl.php

In my template (page.tpl.php file) I have five regions/sections. Header, section#main_prefix, section#main_suffix, and footer. I also have these regions declared in the .info file in my theme. ...
1
vote
1answer
72 views

Region won't show on front-page

I'm customizing a theme and need to have a leaderboard on top of the page. Everything good - on all pages but not the home (front-page)... Any ideas what I did wrong? I've added a region to the .info ...
1
vote
1answer
90 views

Display Content Type Field in region--footer.tpl.php

First of all I am overriding the default footer template with my own using region--footer.tpl.php. In the footer I need to display the fields I have in a content type named 'footer'. Can anyone help ...
1
vote
1answer
21 views

Page region CSS class not applied

I am working with Drupal 8.5-x, I am trying to render HTML with bootstrap classes, but I am having trouble. Here is my problem: I have highlighted (region) and content (region). I am trying to add a &...
1
vote
1answer
911 views

Block Regions in node.html.twig

How can i use block regions in my node.html.twig in drupal 8 ? i tried this : block_get_blocks_by_region but function not found
0
votes
1answer
378 views

Drupal Bootstrap - Regions Placement

I'm making my first attempt at creating my own Sub-Theme of the Bootstrap theme. I've got the theme installed, the sub-theme created and working, I've added some new regions and populated them. The ...
1
vote
1answer
1k views

How to render a region in custom module twig template

I have rendered regions in page.html.twig using {{ page.region_name }}. But it doesn't work for the custom modules template. How can I render a region in custom template?
0
votes
0answers
24 views

Plugin block not displayed in views page

I have a created views (page) to display the number of news articles created in each month (This displays month (number of articles) added in that month like May(12)). I created a content page and ...
0
votes
1answer
24 views

Layout problems (backgrounds and blocks region)

I'm a non professionist dealing with drupal for the first time and it's killing me. I'm trying to create a page without having to code but it seems impossible! I need to adjust the position of the ...

1
2 3 4 5