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

learn more… | top users | synonyms

0
votes
0answers
25 views

Best way to create a custom page section?

I'm looking to create a triptych set of infographics/buttons below the fold of my frontpage. Here's an example for those that don't know what I mean. http://www.dia.org.au/ (The bit highlighted in ...
0
votes
1answer
10 views

The page request for /admin/structure/block only returns part of the html and doesn't render it

I'm logged in to Drupal and am requesting the blocks page at /admin/structure/block. However, the page request doesn't render properly in my browser. (I tried two different browsers with similar ...
0
votes
2answers
38 views

How to find which block is causing PHP errors?

I'm cleaning up a Drupal 7 site and currently its spitting out a bunch of PHP syntax errors pointing to some block that is causing it. It doesn't say which block but only says php_eval() error. So I'm ...
0
votes
0answers
6 views

change message location after saving the search in search_api_saved_search module in drupal 7?

im using search_api_saved_search module to save my search.Whenever i click on save button, error or success message will be displayed in that block region.I want this message to appear in the top of ...
0
votes
4answers
40 views

How can I display block programatically in Drupal 8

I'm developing a site using Drupal 8 beta-14. I've created a view block of different terms and now I want to display it using code. How can I display it programatically? I used to do it in Drupal 7 ...
0
votes
1answer
18 views

How to redirect a menu item to the anchor?

I have created menu with sub-menus. The menu block is placed on the specific page. Drupal menu path allows only allows normal path to be given to menus(like node/nid and pagepath). I want to give ...
1
vote
1answer
12 views

MMenu Module Per Page Configuration

Ok drupalers, A good one. I am using the MMenu module to implement right hand side overlay panels. The site that I am building has two different types of users "Group A" and "Group B". They each ...
0
votes
1answer
25 views

How to echo block title render in specific <div> D7

After creating a dynamic block i need to print block title in specific div or customize it to add css class so please check image for more details Thanks in advance
0
votes
1answer
13 views

How to render specific block from template without rendering entire region

I'm attempting to render a specific block on a page without rendering the region. I'm assuming the machine name of the block is 23 based on the URL I get when configuring the block. ...
0
votes
1answer
13 views

Why aren't the options in my dynamically inserted webform showing up?

I've created a webform with one question that includes a list of checkboxes. I made the webform available as a block, and am rendering the block in my template using: <?php $block = ...
0
votes
2answers
17 views

Placing block inside a node (positioning block between specific elements in node's content)

Basically I created a webform and enabled it as a block, now I want to put that block inside a specific node. I can do that by placing it in a 'content' region and defining the specific node BUT it ...
0
votes
1answer
13 views

created block for image is not displaying

I created the block for a image where in I want to display in all pages, but after creating the blocks once I see the page the created block is not displaying. Following method followed to create a ...
1
vote
1answer
38 views

How to access block fields programmatically?

I display a block of type Assignment on the top of a page when I'm creating a node of type Submission. I need to access the fields of the Assignment block programmatically with my custom module. Are ...
0
votes
1answer
20 views

Block layout - List of all blocks

I'm having a question about the Block layout in Drupal 8. A couple of months ago (I don't know which beta it was) the block layout looked like this: As you can see there's a list of blocks at the ...
0
votes
1answer
13 views

How to show a place holder block if a view is empty

I have a site that has multiple inventory views. When a view is empty (no items to list) I need to display a block that tells the user to check back later. How can I do this?
0
votes
0answers
17 views

Implement multiple views-blocks in a custom template page

I have 3 views-blocks and these blocks should be available with a single url only. Just say example.com/personal-content . I want to place this blocks in this single URL based on a custom design. ...
1
vote
2answers
42 views

Get proper block title from block object

I have a block object in drupal 8 that I am trying to get the title of. I tried $block->label() and it seems to work for some block types, but not for Views blocks. On those, it returns the block's ...
2
votes
2answers
24 views

Edit tabs missing on Views block

I'm new to Drupal and despite making progress over the last few days I've hit a problem. I've got two custom content types linked with an entity reference. I'm using the Views module to create a ...
0
votes
0answers
14 views

No Nice Menu navigation when logged in as admin

I just installed the Nice Menu module for drop-down support on in my theme. It looks all good when visiting the site anonymously, but when I'm logged in as admin the block "Header" doesn't display my ...
0
votes
1answer
36 views

MODULE_preprocess_block() get rendered region in drupal 8

So I am trying to port a Drupal 7 module to Drupal 8, and am struggling with how to translate a "NAME_preprocess_block" method. In the D7 code, it filters by the region a block is getting rendered ...
0
votes
0answers
27 views

Missing Main Page Content Block in Blocks List

I have the region for Main page content in my theme.info file which is regions[content] = Content. But still, in Blocks list, there is no Main page content block. This is causing me problems. Can i ...
0
votes
0answers
24 views

Show user info in DIV based on link click

I'm currently trying to make a 'biography' block with Drupal profile pictures and when you click on them more information (user fields that has been filled in by the Drupal user) will dynamically ...
2
votes
3answers
79 views

Display block on only the listed pages using wildcard excluding subpages.

I have a block I'm displaying using block setting's "Only the listed pages." I'm using a wild card asterisk to show the block on any pages following about-us/ For example: about-us/* The problem is ...
0
votes
1answer
14 views

How drupal handles block['content']?

I am trying to customize a module(quicktabs) for my need. In the hook_block_view, the block['content'] contains an associative array of the contents. Is there an existing drupal call that renders the ...
0
votes
4answers
40 views

Display the content of particular content type in side a block?

I tried to create a block called contact details. I already created a content type called contact.I wanted to add the content of each contact content type in my custom block. I researched a lot..and ...
0
votes
1answer
19 views

How do I effect the page that a menu item redirects to?

I am trying to do something that seems simple, but I have yet to have to do it with my development because I have always dealt with forms and views. On the page that I get redirected to when I click ...
0
votes
0answers
12 views

Menu Block drop down links disappeared?

On my Drupal 7 site, I was pruning the permissions of a limited access role. I must have inadvertently disabled the permission that allows for Menu Blocks to display the gear icon dropdown with "List ...
0
votes
1answer
16 views

Are blocks still cached when “Cache block” setting disabled but “Cache pages for anonymous users” is enabled?

I have a site which contains a custom block. The custom block contains a menu based on a sub-set of the site's main menu. The problem is that main menu is very large (~1300 items), so generating ...
0
votes
1answer
20 views

Why can not Drupal find my theme for a custom block?

I read this answer, but I can not figure out, why my block is not shown. My block is activated in footer and should appear on <front>. /** * Implements hook_theme(). */ function ...
0
votes
1answer
32 views

How to display block using hook_block on specific pages only

I am creating the block using the following code , but i need to dsiplay this block only in specific pages only . How can i achieve this ? function mailusers_block($op = 'list', $delta = 0, $edit = ...
0
votes
1answer
19 views

Copy blocks from one drupal installation to another

With a lot of help from the users of this forum yesterday I managed to get my local installation running. I have copied across the theme from the site I wish to base mine on (with the permission of ...
0
votes
1answer
30 views

footer block through custom module and fetch node image field in Drupal 7

I want to create footer block through custom module and want to add five images through node.Five images should change one by one after one hour. Can anybody tell me how to do this ? <?php ...
1
vote
1answer
27 views

Why making a Views page instead of Views block? [closed]

In most of my projects views are displayed in a block instead of a page, eventhough it would be perfectly possible to make a views page in these cases. The reasons why I do this: If the client ...
0
votes
3answers
72 views

Display custom block to specific content type programmatically

I created one custom module, it will create one custom block when it is installed. I want to display it on "product" content type only. Can I do the same with programmatically. It'll save my time. ...
2
votes
2answers
60 views

Overriding Drupal core base class

I need to override the block configuration form in Drupal 8. To override the configuration form for a new block we are creating can be done by implementing BlockBase::buildConfigurationForm method. ...
0
votes
0answers
23 views

Strange Drupal Image Problem in Blocks

Recently, I worked through a peculiar image problem in Drupal 7 blocks. There were several people working on the site initially, and changes were made to the image modules which may account for the ...
0
votes
0answers
17 views

Image as link to content does not work in views nivo slider

Details: Drupal 7.38 Views Nivo Slider - Link image to content View as a Block. I formed a view with nivo slider. In which I want my images are linked to the content. But the link is not working. ...
0
votes
1answer
52 views

drupal 8-b12: how to assign variables from BlockBase-Instance to twig-template

I want to create a Block-Module for drupal 8 (beta 12). To display the Content I want to use a twig-template (mytest-block.html.twig). But the Twig-Template needs some Data to Display, So I need a ...
0
votes
2answers
41 views

How to embed images with blocks

Am newbie to Drupal this is my first question i want to embed my images on the blocks body, so i tried below code to embed <div class="topsection"> <div class="wrapper"> ...
0
votes
2answers
27 views

Unable to submit form to database in custom module

I am building a custom module and I'm unable to get the form to talk to the database. The section for uploading to the file system works fine. This is MyModuleBlock.php <?php namespace ...
0
votes
1answer
46 views

Render a webform to another node

I have a new text format sample_page with the filter sample_page, I've created using hook_filter_info(). In the callback, I am rendering a webform using depending on the token in the node body, for ...
0
votes
0answers
26 views

How display custom block in custom content type

I have custom block: function node_to_word_block_info(){ $blocks = array(); $blocks['save_as_word'] = array( 'info' => t('Node to word'), ); return $blocks; } function ...
0
votes
1answer
26 views

Print Block heading for $page - section

In my page.tpl.php I have 2 different sections nl. $page['section_orange'] and $page['section_contact']. What I want is for my block.tpl.php to print my heading in h2 when a block is listed in the ...
0
votes
0answers
18 views

how to create a module that declare a block that contains a link to a specific page using l() function? [duplicate]

I want to add a block that contains a link to a specific page. this is can be created using the l() function but it must be declared in a module,So i created a module with two files .info and .module. ...
0
votes
3answers
45 views

How to filter admin/structure/block per role

I use block access to determine which block a role can edit. I enabled Access the block administration page and View all blocks permissions so that my blocks_editor role now can access the ...
0
votes
2answers
35 views

Remove clearfix from section class in custom theme

I'm attempting to edit the template for my pages to allow it to show the content with a block beside it rather than beneath it. I'm currently using bootstrap to lay out my grid. In my page.tpl.php I ...
0
votes
2answers
34 views

Cannot find out what is rendering a view block?

I am working on an existing Drupal 7 website. I have a view that has a block display. The block is being displayed on some pages in the "second_sidebar" region. The mystery is that I cannot figure out ...
0
votes
0answers
66 views

Attach CSS with hook_block_view

So I've attached CSS with this code to my custom block: function expressweb_newsletter_block_view($delta='') { $block = array(); switch($delta) { case 'newsletter_popup_and_icon' : ...
0
votes
0answers
29 views

Getting html tags in translated block display

I created a block and enabled its translation settings. I followed this link to add ckeditor at block translation. When I view the translated block its shows block contents with html tags. Eg: If ...
0
votes
1answer
16 views

“Disabled” regions re-enable after navigating away and back from module page

I have a form module that I would like to have on its own page, with no header, footer, etc.. I thought I was successful with adding hook_menu() and a page callback to render the form's block, then ...