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
9
votes
2 answers

Assign a block to more than 1 region

How do I assign a block (the very same block) twice or thrice to different regions? The idea is not to have the same block on the same page more than once, but in different locations on different pages, so four 'displays' would be available: Block…
Rudie
  • 52,220
  • 42
  • 131
  • 173
7
votes
1 answer

How can i add my custom form to custom block in my custom module

I've made a custom Drupal module. Inside which I've created a block and a form. How can I make the form appear in the block content? Cheers. Block Code: function module_block($op = 'list', $delta = 0, $edit = array()) { $block = array(); if…
Doyle
  • 295
  • 2
  • 8
7
votes
1 answer

How can I create multiple different blocks in one module in Drupal 6?

I'm using hook_block to create a block with the name of the custom module I'm creating. I'm not being able to create a block without using myModuleName_block. Do I need to do different modules for every different block I want to create?
ino
  • 273
  • 2
  • 13
5
votes
3 answers

My custom block doesn't show up in the block library

I am developing a custom module in Drupal 8. It shows data regarding some organizations that make use of our service. For this I have created a Controller that shows data from the database, which is put there by another module. From the scarce…
Jacques
  • 223
  • 3
  • 16
5
votes
2 answers

Tabs in a block

I want to create a block which contains the $tabs from page.tpl.php /** * Implements hook_block_info(). */ function mymodule_block_info() { $blocks['tabs'] = array( 'info' => t('Tabs in block'), 'description' => t('blah blah blah'), …
tolborg
  • 612
  • 4
  • 21
4
votes
2 answers

How to display a block only on certain page view display

What is the snippet of code to make a block just show in pages generated by a certain View? Using Drupal 6 with Views 2.
Naoise Golden
  • 8,793
  • 4
  • 49
  • 65
4
votes
4 answers

Drupal Search in Block View

i need to create a block View with a search box attach to the header in order to search nodes for one specific content type. I don't know how to achieve this, so i ask for your help. Something like the attached photo.
Gerardo
  • 5,800
  • 11
  • 66
  • 94
4
votes
1 answer

I am not able to reorder the blocks in drupal 7

I have more than 200 blocks in my drupal website. Right now I am not able to reorder the blocks from the admin end. I can drag and drop the blocks. So there is no problem with my js (I think so). After saving the blocks, selected blocks went to the…
Navane
  • 1,348
  • 2
  • 12
  • 25
3
votes
6 answers

How to add custom fields to blocks in Drupal 7?

I'd like to be able to add custom fields to blocks in Drupal? I have a header area that spans the entire width of the page. Below that will be a left column for body content and right sidebar for various blocks. The header area needs to have a…
Dustin
  • 4,314
  • 12
  • 53
  • 91
3
votes
3 answers

In Drupal 7, how do I get a list of all blocks being used on the page?

I'm building a module that manages ad units in the form of blocks that all need to be aware of each other and pass information around. Thus I need to find a simple hook or other function to get a listing of every block that will be used on the…
Adam Friedman
  • 520
  • 6
  • 20
3
votes
1 answer

Drupal 8 how to create a template for a custom block type

I want to create a template for a custom block type I've created by going to structure/block layout/ types/ add custom block type. The type I've created is called menu. How do i create a template for this custom block type from here? I'm not as…
3
votes
1 answer

Drupal custom query with localization (How to get user language)

I have a block that querys the database for a node, however the node can be translated to english/spanish/... Is there a way to get the user's selected language so I can update the query to something like "AND node.language = 'x'"…
kilrizzy
  • 2,895
  • 6
  • 40
  • 63
3
votes
0 answers

Custom blocks not displaying in Drupal 8

For some reason, any new custom block I create on my Drupal 8 site won't display or render in the DOM after placing the custom block in the region that I want. I've tried clearing cache multiple times, but it's as if custom blocks stopped…
Milo525
  • 39
  • 2
3
votes
1 answer

user-menu in secondary-menu: why?

I've created a sub of the zen-theme. And am mighty proud of it, but up in the top right corner (#secondary-menu) the user-menu shows up - perfectly. I just don't understand how it get's there? In structure/blocks the user-menu appears in the…
T4NK3R
  • 4,245
  • 3
  • 23
  • 25
2
votes
0 answers

Errors when I access "block" page on drupal

Does anyone have any idea why I could be getting these errors when I access my "blocks" page? warning: Attempt to assign property of non-object in /home/traders/public_html/includes/common.inc on line 3475. warning: Attempt to assign property…
Dylan
  • 412
  • 4
  • 19
1
2 3
10 11