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
25 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 (...
0
votes
1answer
27 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
78 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="" ...
0
votes
0answers
15 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
82 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 ...
2
votes
1answer
460 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 ...
1
vote
1answer
18 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 &...
0
votes
1answer
173 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
662 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
19 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
23 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 ...
2
votes
2answers
59 views

Unset regions for specific content type

I want to create a special content type that doesn't include the logo and main navigation. I have a helper module and have added the following section before renenabling it but it doesn't seem to be ...
0
votes
1answer
40 views

Move a taxonomy page field to a different region

I currently have taxonomy pages using a custom image field, field_icon, which by default displays in my content region. How would I go about moving this field display to a different region (in my ...
2
votes
2answers
667 views

Add image field or other fields from node to a custom Block in Drupal 8

I am new to Drupal and I am learning pretty fast. However I am stuck on an issue. I need to make a custom Block for my content (node) images. There is a system-made content block which pulls from ...
1
vote
0answers
105 views

Separate blocks in region

I have a Footer region defined for my theme, and it has two blocks in it. I have a region--footer.html.twig file and both blocks are rendered with {{ content }}. The issue is, I need to wrap both ...
0
votes
4answers
394 views

Render a menu differently based on region

I use Drupal 7 and I’d like to have two menus rendered different: one in the nav bar showing dropdowns links for child pages, and another that simply lays out all links in the sidebar. While I can get ...
-1
votes
1answer
264 views

Express block in region template

I have region--footer-sustain.html.twig which is expressed in templates via {{page['footer_sustain']}}. Client wants some content moved into the CMS so I added to theme_info.yml these regions: ...
0
votes
1answer
3k views

How to add custom region in bootstrap theme Drupal 8

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 Header region. Want to know how to add in theme.info ...
0
votes
1answer
516 views

Set regions size

Very new Drupal user and I'm building a theme for my site on Drupal 8, I've setup everything, the site works locally. Now I would like to know how do I make my regions look like the schema (see Image)....
1
vote
1answer
34 views

Theme settings not saving after adding new regions

D8.2x - using adaptive theme. I have successfully added new regions but have not yet been able to add as many as I need. The theme settings save, then I add another region and they do not. Please ...
0
votes
1answer
300 views

Block title not show for exposed filter

My exposed filter's form is placed in a region, within a block. I have activated the Config Block > Display Title option (I also overrode the title) but I see no title (a h2 should be added on top of ...
2
votes
1answer
678 views

Region for the footer not working, but the header is working

I have the following regions set up in my *.info.yml file: name: Test type: theme description: 'Theme' base theme: stable core: 8.x regions: header: 'Header' content: 'Content' footer: 'Footer' ...
2
votes
1answer
559 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
1answer
48 views

How do I place a block in a region, programatically?

Why isn't my custom block rendering in the region I want? It shows in the content region, not my custom content_right region. function bootstrap_preprocess_html(&$variables) { if (\Drupal::...
1
vote
1answer
28 views

Block is displayed on page even though no region is selected, how is this possible?

I am fairly new to drupal, while doing some maintenance I came across a situation that I don't understand A block, which is defined inside a view has no region selected, yet it appears on pages ...
0
votes
1answer
316 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
2answers
2k views

Custom region twig template for region into node twig template

I did add a custom region to my theme via my .info.yml file : regions: node_col_1: 'Bloc pour colonne 1' and in my .theme file to make it available for node template: function ...
0
votes
1answer
201 views

Placing Content Outside of Region Container

My custom bootstrap sub-theme has a main content region which is the place that all the main content is to go within a .container class. The code for that section is as follows: {# Main #} {%...
0
votes
1answer
30 views

How do I get the content of a Panel variant to display on as Content?

I've made a module that you can add to a Panel Variant's Content section by clicking a region's gear icon and selecting 'add content'. This seems to work fine and I can view the module's output if I ...
0
votes
0answers
56 views

Programmatically rearrange blocks in region and save in database?

Need to react on site events and regroup blocks in front. I have my region 'Top' in front, configuration is like this: Block2: India News Block1: World News Block3: Frontpage content When new ...
1
vote
1answer
51 views

How to detect the region of a block programatically

I need to create a custom submit handler when blocks that are assigned to a certain region are saved (whether an existing or a new block) I am using : function MY_MODULE_NAME_form_alter(&$form, $...
2
votes
2answers
816 views

Render a region e.g page.sidebar_first in views-view.html.twig

Is it possible to render a region e.g sidebar_first in a views twig-file views-view.html.twig?
1
vote
1answer
49 views

How to show one field in more than one regions?

I'm using Drupal 7. I have used two column stacked layout to display Node Fields. I created one Rating Field and I showed it in top region. I want to show the same field in bottom region also. How can ...
1
vote
1answer
82 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 ...
0
votes
1answer
138 views

How to add programmatically region's class when region had block in D8?

I have one row three column region. How can I add custom class on each region when one of region is not work? When three regiosn work, classes will be below |------------|-------------|--------------...
1
vote
2answers
643 views

Insert region into html.html.twig

Is there any way to add a region into html.html.twig? I want to have one inside tag to be able to render different js counters through Block Layout
0
votes
1answer
44 views

Placing user login and user menu at the bottom right when this is not supported by the theme

I'm new at Drupal and am building a site with the Bootstrap theme, and i would like to place the user login and user menu in the lower right corner. Unfortunately there is no region for that, there is ...
1
vote
1answer
2k views

Determine which region a menu block is rendered in

I need to re-use the same menu in two different regions, with slightly different markup. My thought was to simply check which region the block was being rendered in, and use if statements to modify ...
2
votes
3answers
354 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 }}). ...
0
votes
2answers
224 views

How to let a user to 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 ...
1
vote
2answers
346 views

Dynamic weight for Blocks

I want to change the block weight in sidebar for each page request, So the blocks position would be change for each request. Is there any way to do it ?
4
votes
1answer
1k 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
68 views

Custom Region Empty

I have created a custom region in my bootstrap sub-theme. The line in my .info file is: regions[conent_bottom] = 'Content bottom' I have then added that to my page.tpl.php file using: <?php ...
0
votes
1answer
371 views

How to add cache contexts to a region

How can I add cache contexts to a region. I have been able to do this to my blocks but have noticed that parts of the region remain cached.
3
votes
2answers
3k views

How to print status message on specific region or block? [closed]

See this picture i want also the status message or error message to display on header region not only on content region.
1
vote
3answers
3k 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 | |...
0
votes
1answer
91 views

Block not showing on page

I have a weird issue with a D6 site... A block I've created will not show up on the page. It appears to be disabled in the blocks list, although other blocks that /are/ showing up seem to be disabled ...
2
votes
1answer
218 views

'A' tags in Custom Blocks get removed

I created a few regions for my footer. Inside of each region I've added a custom block with plain html code. One has the contact info, another has social media icons and the last one has a map. The ...
4
votes
3answers
2k 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 ...
1
vote
1answer
48 views

Edit the display of view on drupal 8

Currently working on theming with Twig I created a region called 'Blog Content' I placed under it a view that i recently created Called 'Blog' with a display Block to display just the 3 last article** ...