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

learn more… | top users | synonyms

0
votes
0answers
9 views

Dashboard customization [on hold]

I have customize user_dashboard module for fulling my functional requirements. I am using drag and drop functionality of that module. My scenario is like, I am having one canvas, on which i have ...
0
votes
1answer
19 views

Why making a Views page instead of Views block?

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
47 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. ...
-1
votes
0answers
21 views

How to generate a template on every block creation?

I am creating blocks dynamically. So, What I want is, whenever a block gets created, a template should generate in sites/all/current-theme/templates folder whose name should equals to block machine ...
2
votes
2answers
55 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
22 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
9 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. ...
-5
votes
0answers
25 views

How to implement a pintarest pinnumber in drupal? [closed]

I have a pin number for a pintarest widget. The following should come in a block (say: pintarest_widget1). <a data-pin-do="embedPin" ...
0
votes
1answer
26 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
35 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
26 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
31 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
23 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
24 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
37 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
25 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
27 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
51 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
22 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
15 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 ...
0
votes
0answers
8 views

Insert code in views-view-unformatted.html.twig for specific rows in views

Twig template - views-view-unformatted.html.twig: #} {% if title %} <h3>{{ title }}</h3> {% endif %} {% for row in rows %} {% set row_classes = [ default_row_class ? 'views-row', ] %} ...
0
votes
0answers
20 views

Drop-down containing blocks

I am working on building a new site in Drupal 7 and would like to have accessibility options. I'm using the Page Style and Text Size modules, which provide blocks that contain the accessibility ...
0
votes
0answers
10 views

How to create a custom markup for a views-block in Drupal 8

I'm trying to understand the templating system of Drupal 8, allready did some basic stuff. My next step is trying to create a template to mark up a list generated by a view. Here's what I've done so ...
1
vote
2answers
25 views

How to show a block on user profile edit page ?

I am trying to display a block on an user edit page (example: user/123/edit/custom_url, but for some reason, I can't seem to get it working. Any help is appreciated. I tried this, but this isn't ...
0
votes
1answer
32 views

How to change color and sidebar menu without using themes

We have a number of different themes on our website as we have different departments with different color styles. However, the only thing that changes are the colors of the sidebar and which menu is ...
0
votes
1answer
30 views

Two random blocks displaying different fields from the same node

I have a content type with field_1 and field_2. I want to have two blocks displaying different fields from a one random node. I can easily create two random blocks via views module, but they wil not ...
0
votes
1answer
29 views

Firefox/IE not displaying CSS with Drupal website

In Firefox and IE (and maybe others?) it seems that the blocks that are built by drupal aren't having CSS applied to them. Any help at all would be wonderful, as the issue I'm having is not knowing ...
0
votes
1answer
19 views

Banner block (referenced by url) not displayed when using language extensions

I have a Banner View block that appears on pages using a reference url field. When the url: thispage is entered in the reference field of the banner, it appears on domain.com/thispage. Now that i ...
0
votes
2answers
51 views

how to add background images to blocks?

How to upload background images to blocks individually ? Is there any contributed modules available uploading background images to blocks?
0
votes
3answers
43 views

call external form in ajax callback

I have two forms (A & B) in custom module. Form A containing three fields(each field is dependent drop down) and Form B containing only one field (markup field to show data). The problem is that ...
0
votes
1answer
50 views

Adding custom block problems

I've created my own module in drupal 8. I also created block in my module. I tryied to add my custom block (which is type of custom form) to view. But when I am trying to add custom block in view, its ...
0
votes
1answer
24 views

Render a custom menu in a custom block

I want to create a block that contains somes links of a menu, without using the interface. So I created a custom module. Inside, there are somes files. a mymodule/test.links.menu.yml : ...
0
votes
1answer
14 views

Ajax form in block

From my experience, I believe Drupal8 treat Form API in BlockBase differently from FormBase Class, the below block doesn't seem to work. Do I have to do anything else to make Ajax Form work in Block? ...
0
votes
3answers
64 views

Display a block on front page only

How do I only show a block on the front page. I have on only listed pages under block settings and it won't disappear on the second page. I've also added $is_front drupal_is_front_page around the ...
0
votes
0answers
22 views

Call block in template file

Is there some simple code I can add to my page.tpl.php to call a block directly from the template file? I cannot add modules to this site Users need to be able to edit the contents of the block ...
0
votes
1answer
37 views

How to get Views Total number of records in Page.tpl.php file. (Before Views rendered)

See this image for more understanding. I want to fetch Views total number of records in page.tpl.php before views.tpl called. Is it possible to fetch that row total before views rendered? I am also ...
0
votes
1answer
33 views

Programmatically get menu block & alter classes

I'm invoking a menu block programmatically using: module_invoke('menu_block', 'block_view', 13); What I want to do is change and add classes to the wrapper & ul tags of the menu block, is ...
1
vote
0answers
28 views

Parameters in the HTTP request

I am trying to render a block depending on the parameter(entity) present in the requested page. Suppose if I am on a url like this: http://localhost/drupal8/user/1 then a block with label user is ...
2
votes
1answer
25 views

How to hide a block enitirely which has empty content (unless for a specific role)?

I have a custom block and I want to limit it only to one role. The position of this block is administrator->dashboard. I have set the visibility settings of block to be shown only to role editor, but ...
1
vote
1answer
21 views

How do i use Views to display articles in sticky footer

Not sure if i am going about this the right way but my intended goal is this: Create a sticky footer that displays: In Section 1(Left section) a Link to Latest magazine issue. In Section 2 (Right ...
0
votes
0answers
9 views

Cannot display output view block under or after exposed filters block

I created few exposed filters in block. However when I hit 'apply', I get its output view displayed on top of the exposed filters in a separate block. Is their any way or code through which I can ...
0
votes
1answer
38 views

All instances of block are not getting removed

This question is a continuation of this Block in Drupal 8, The second problem I am facing is that suppose I select block made for comment section and place it under Sidebar second section and ...
0
votes
1answer
13 views

How to find the count of items in a block?

I have a block named views-view-fields--our-services--block.tpl.php i need to find the no of nodes under this block.How do find the total no of nodes displaying inside a block?
0
votes
1answer
39 views

Block in Drupal 8

I have coded a plugin in my module which extends block base and generates labels for block in /admin/structure/block page under Place block. These block are being generated for different entities. The ...
0
votes
1answer
25 views

How to remove inner div from create block in drupal 7

Here, i struggling to remove inner div from create block in drupal 7.Here my working code with wrong result: <div class="ft_bottom"> <div class="container"> <div class="col-md-7"> ...
0
votes
1answer
41 views

How can I serve different view blocks based on media queries?

I have 4 view blocks that I want to show up as carousels on mobile. I'd like to be able to clone them, turn the clones into carousels with this module https://www.drupal.org/project/slick, then serve ...
0
votes
1answer
32 views

how to insert the See All link in a drupal view block

i created a News block that display only 3 lasted news, and i want create a button "See All News" how i can do it ?
1
vote
1answer
30 views

Redirecting doesn't work with a custom form in a block

I developed a custom form with FAPI and added a block for it. Block is included only on one specific page (basic node). When user submits this form it should redirect user to external site (URL is a ...
0
votes
1answer
45 views

Mini panel vs Block in Drupal 7

I am a newbie in Drupal. Can anybody explain how is block different from mini panel.