Questions tagged [drupal-blocks]

Blocks are self-contained collections of content and functionality that are displayed from Drupal within theme regions.

Blocks are self-contained collections of content and functionality that are displayed from Drupal within theme regions.

See also

162 questions
2
votes
3 answers

Drupal: How to show specific view in a particular block

Let's suppose I have created a view that shows some kind of stories. But I want to show this view in a left-hand bar — not a link to the view, but the view itself. How can I connect my new view with a fixed block position? I want to be able to show…
AlexA
  • 4,028
  • 8
  • 51
  • 84
2
votes
1 answer

Drupal 7: calling "menu block" into page.tpl.php

I have the Menu block module installed; I created a second level menu as block via "add menu block" at the block page, and assigned it to the content area. It displays the menu block at the end of page content, but I need that just after the page…
2
votes
0 answers

Drupal 8 - Hook theme not found, twig and CSS for custom Block not working

I'm working on a custom module that has a block. This block has a form in configuration where user input the relative data, so far it works its saving the data and it display it but without a template (twig). I was able to make it work with a twig…
2
votes
1 answer

Restrict block visibility by page and content type in Drupal 8

I declared a block to display the 3 most recent articles published and I would like to display it on a specific page so I added /my-page/ into the block page list but it didn't worked. I then changed it to /my-page* and it worked but I ended up…
Tibo
  • 523
  • 1
  • 8
  • 20
2
votes
3 answers

embed block anywhere fails at drupal 7

It's been a week I have played around with drupal 7. With drupal 6, I used to be able to place (login) block anywhere with this: $block = (object) module_invoke($module, 'block', 'view', $delta); $block->module = $module; $block->delta =…
swan
  • 2,509
  • 3
  • 24
  • 40
2
votes
1 answer

drupal 8 display block in view footer/header

in drupal 8 core views, in any view you can add header or footer field with "Rendered entity - Custom block". When you do so, it asks for the block id, which appearently is machine name of the block. A search form block has an id equal to…
Yog
  • 139
  • 2
  • 8
2
votes
3 answers

How to have the block driven by the page being visited as opposed to the user who is signed in

Im very new at drupal. My problem is that the block is consistent and not changing. It seems to be based on the user signed in as opposed to the page being visited (ie, in the multi-user blog, each block should reflect the page of the blogger being…
MAds
  • 31
  • 4
2
votes
3 answers

drupal block display

is there any way to place a block in different regions without duplicating it . for ex consider a block1 and its display regions requirement page1 lefttop page2 right how to configure block1 in 2 different regions ?
ArK
  • 20,698
  • 67
  • 109
  • 136
2
votes
3 answers

Drupal: assign block to a specific content type

I made a customized template called node-mynode.tpl.php Whenever a node of type mynode is requested, then node-mynode.tpl.php is automatically used. However, now user wants to see a specific menu block in this case. Question: How can I assign a…
bert
  • 287
  • 6
  • 14
2
votes
1 answer

Using variable_set, hook block and hook menu to save config values then print out in custom template

I am trying to 1) implement the hook menu and variable_set in the block hook and to solicit and store configuration values from user, 2) then use retrieve configuration values and 3) pass them out into a template using theme hook when page is…
bert
  • 287
  • 6
  • 14
2
votes
1 answer

Cache: How to exempt just one block

I've got a Drupal 6.x install, and there is one block generated by the Station module which displays the name of the show currently playing. Is there a way to make just that block exempt from caching? Alternatively, can I insert a 'refresh' for…
2
votes
1 answer

Drupal 6 preprocess blocks & nodes

I build a BLOCK that sits on a right side of the website and is available for whole site. Also I got a many CONTENT_TYPE NODES like (pages, news,gallery, files). How can I modify _preprocess_xxxxx and which one, so I can let my BLOCK know which…
David King
  • 2,010
  • 5
  • 19
  • 23
2
votes
2 answers

How to retrieve parent page's $node variable in a block using module_invoke()?

I'm using module_invoke() to include a block and I need in this block to read a value contained in my parent content type page. So how can I get the $node variable in my block from the view? Code I'm using:
Benoit Wickramarachi
  • 6,096
  • 5
  • 36
  • 46
2
votes
1 answer

Setting pages on which block will appear in Drupal installation profile

Created installation profile and need to make some custom block be visible on particular pages. In profile_name.install : profile_name_install(): $values = array( array( 'module' => 'my_custom_module', 'delta' => 'my_block',…
Jokerius
  • 1,310
  • 1
  • 14
  • 22
2
votes
3 answers

Am I understanding Drupal regions and views correctly?

We're building a very content rich site in Drupal. It's my first time working with it. There are a variety of sections to this site, each with a different layout. I plan on determining the page.tpl.php via the phptemplate_preprocess_page()…
Doug P
  • 361
  • 1
  • 4
  • 15
1
2
3
10 11