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

learn more… | top users | synonyms

0
votes
0answers
10 views

What are the reasons that the “Show block on specific pages” settings wouldn't work?

I have a site with a large number of blocks, but I just added a new one that's only supposed to show on one page but it shows on every page. If I exchange it with another block I have the same problem....
0
votes
1answer
9 views

How to show difference between views page and views block

I have created a view page, to this same page I will add a block by clicking on add button. So whatever changes I will do in the block is affecting the view page also. So how can I configure this, so ...
1
vote
0answers
13 views

How to embed a views page and views block in a page?

I want to show two views in a single page. I have created a view page and I have one view block. So how can I attach these two views. I followed this below url, but i didn't get the attchment option ...
1
vote
2answers
44 views

Create Block Programmatically

I am learning Drupal 8, i know how to create block programmatically in Drupal 7. Can anyone please suggest how can u create block and render that block in more than one region in Drupal 8?
0
votes
1answer
15 views

What is the programmatic equivalent of block save?

From hook_save(), I've updated the "pages" attribute of a block, adding a path to the list. db_update('block') ->fields(array('pages' => $pages)) ->condition('delta', $delta) -&...
0
votes
1answer
26 views

How to show year/months in archive block?

I want to create a archive block for blogs. I tried by using default archive view block, bot that structure is not suitable for my requirement. I need years to display and when I click on years, ...
0
votes
0answers
8 views

How to show auto archived content in auto archive module

I have a requirement of archiving the blogs. So I have used auto archive module,with this module I will get archive option while adding contents. But my question is how can I show these year-wise data ...
0
votes
0answers
32 views

how to get block body programaticaly [duplicate]

I have created custom block from Admin side like block/add , I want to display it content in hook_alter .module file.
1
vote
1answer
18 views

block['content'] text with form

I created a form and used a block to show it. I would like to add a message before the form. Before I added "You can use the form below," the form was working fine. Right now, it doesn't work. The ...
0
votes
1answer
12 views

PDO expecption error while adding class to the block with sql server

"PDOException: SQLSTATE[42S22]: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Invalid column name 'css_class'.: UPDATE block SET [css_class]=:db_update_placeholder_0 WHERE ([module] = :...
1
vote
2answers
34 views

Prevent block from caching

I have a custom block that reads information from the database. As the user will be filling out a form, refreshing the page and viewing the block it cannot be cached. How do I fix this? I have tried: ...
0
votes
0answers
16 views

Nice Menus breaks blocks

I tried moving an entire Drupal website from XAMPP to Apache in Linux. Everything went alright. However, when I try to clear the cache, or enter block edition, I get the following error: PDOException:...
-1
votes
0answers
6 views

Drupal Menu usign Carousel [closed]

I have 2 pages: http://www.locnstor247.com/tips/packing-tips and http://www.locnstor247.com/tips/storage-tips The packing tips is working fine for the carousel links from right sidebar, but for some ...
1
vote
1answer
45 views

How to exclude all blocks on a specific page?

I have a website that uses themekey to display a different theme for one page. I use the context module to display blocks across the site (*). I tried to exclude the page I don't wish to display ...
0
votes
1answer
29 views

use entityQuery within a Block plugin

I'm attempting to use queries within a block plugin to avoid using views for performance purposes. namespace Drupal\my_plugins\Plugin\Block; use Drupal\Core\Block\BlockBase; use Drupal\Core\Form\...
0
votes
1answer
38 views

How to access field values from a custom block

How do you give a custom block (in a custom module) access to field values produced by the context of page? eg: If the page has a field, say 'field_my_custom_id' and I want to use it for some purpose ...
0
votes
2answers
30 views

Extend Block Class

I created a block plugin that adds the ability to specify style settings by adding a form for configuring the styles. Is it possible to extend the block class so that all blocks have this capability ...
1
vote
0answers
16 views

How to display the 4th level of a menu using the Menu Block module?

I use the Menu block module for a menu block that should display the 3rd and 4th levels of my main menu. It works great for the 3rd level of my menu, but for some reason I can't get it to display the ...
1
vote
1answer
61 views

Syntax for using getValue to get value in an array

I created a form for a block plugin. I'm attempting to save the values to the form after submitting. However I'm having trouble saving the values if they are within an array. For instance public ...
0
votes
1answer
24 views

Using arrays when setting values in defaultConfiguration() of BlockForm in BlockBase

I'm writing a block plugin that allows you to specify certain values for the block in the panel pane editor. I'm able to defined the default values using public function defaultConfiguration() { ...
0
votes
0answers
23 views

Add a custom markup to the title

I created a custom block plugin to allow users to easily customize various elements of the block using configuration options in panels. public function build(){ return array( '#type' =>...
0
votes
1answer
23 views

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table

In my site, I get the following error: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'cambodia_ohchrProduction.ohchr_cache_block' doesn't exist: TRUNCATE {cache_block} ; ...
1
vote
1answer
30 views

How to reverse engineer a section of a Drupal Page

Sorry if this is a beginner or inappropriate question, but I'm trying to work on modifying a complex Drupal site and I have no idea how to find out how it's built. At the top of the home page there'...
0
votes
0answers
27 views

how to redirect exposed filter search box input result

Result +================================================================== Displaying as a BLOCK VIEW on click of submit results should be displayed in new page. instead of showing below to ...
-1
votes
0answers
11 views

Not multiblock enabled error throwing while creating block instance [on hold]

i try to create a new block instance using exposed form block.but it throws not multiblock enabled.
0
votes
0answers
20 views

How to specify bundle type in custom block written programmatically?

How to specify bundle for the blocks you build programmatically since you need block bundles to entity reference the block?
0
votes
0answers
7 views

Main menu level 2 template

I have my main navigation menu setup with 2 levels with only one level expanded by default. I then placed a second version of the menu in a different block and set the Initial Menu Level to 2 so on ...
0
votes
0answers
10 views

Google Content Experiments on a Block?

Is it possible to create a Google Analytics Content Experiment to test 2 different Blocks on my homepage without having to create 2 versions of the homepage?
0
votes
0answers
17 views

Template suggestions priorities changes unexpectedaly for sub-theme

Working on Drupal 8, we have a strange issue regarding template suggestions priorities. We have a parent theme (my_base_theme) which has 2 templates for menu blocks: block--system-menu-block.html....
0
votes
0answers
18 views

Embed User Location in a block

I am trying to create a block that will allow the user to change their location on any page, not just on their user profile edit page. I am using the Location module, and assigning one location value ...
0
votes
0answers
5 views

Use bean_load in tpl.php

I have created tpl file in module for block. Which is working fine. Got help from here. Now, I wan to use bean_load function in that file, which is actually not working/loading the block by id. How ...
1
vote
1answer
36 views

How to programmatically load a rendered view exposed filter block

I'm in Drupal 8 trying to load a Views Exposed Filter block based on its ID, similarly to how I would load a content block. $bid = 'exposedformview_nameview_display_name'; // Found on mysite.test/...
0
votes
0answers
14 views

Add javascript 'data' in hook_preprocess_HOOK

Looking for a good way to include javascript in hook_preprocess_HOOK, specifically hook_preprocess_block. I don't want to use drupal_add_js because this only fires once per cache create (learned that ...
0
votes
1answer
13 views

Views Block Caching issue for not logged in User

We are using Drupal inbuilt caching with Memcache. Our website home page has more than 5 blocks created using Views for which we have enabled Time based caching. But the contents are not getting ...
0
votes
1answer
14 views

Visibility problem with 'restricted to certain pages'

I'm porting a site from D6 to D8 and having problems with block visibility for listed pages. I have a config like this which worked on D6: news news/* And pages like /news/op-ed-suu-kyis-plan-...
1
vote
1answer
50 views

How to hide a block in a view when an exposed filter is being applied?

I have built a view with exposed filters. There is a 'popular content' block on this page which I am controlling using the Context module (https://www.drupal.org/project/context) I would like it so ...
0
votes
0answers
16 views

Organic Group Members in Node Rather Than Block

Pretty much summarized in the title, I was wondering if there was a way to include the list of members (and maybe the content) as lists within the node content itself, rather than the blocks they can ...
0
votes
0answers
23 views

How to validate block form

On Drupal 8.1... In my custom module hubBlock: namespace Drupal\hub\Plugin\Block; use Drupal\Core\Block\BlockBase; use Drupal\Core\Block\BlockPluginInterface; use Drupal\Core\Form\...
0
votes
2answers
28 views

How do I change ID to a custom one?

How can I change the view block ID from block-views-portfolio-view-block to portfolio?
1
vote
1answer
35 views

How can I control block visibility with code?

In Drupal 6, I could control block visibility using PHP code in the block UI configuration like: <?php return MYMODULE_abc() || MYMODULE_def() ; ?> These functions looked up the current node, ...
-1
votes
0answers
19 views

Showing a block basing on the content of a node field

I try using the php-code below to show a block, based on the value of a field "field_support" (which is an integer list). When the value is 1, it should be shown. When '0', it should be hidden. The ...
-3
votes
0answers
33 views

I want to set “Home” page my website's default screen

When i click on the home picture in tool bar, it is showing blanks screen. If i click on the Website name, same thing happens. I want to set Home page at both this place. Can someone help me with this ...
4
votes
1answer
48 views

how do I add contextual edit links in block template for a block entity?

In Drupal 8, how do I add contextual edit links in a block template? This is for block entities created at /block/add, not block plugins created by a class in a custom module. I want an edit link to ...
0
votes
0answers
6 views

No content edit box in Execute PHP block from panels

I created an "Execute PHP" content item in Panels, which created a "PHP block" in the Block system named "Execute PHP". Trouble is, on the configure page /admin/structure/block/manage/devel/...
1
vote
1answer
62 views

Pass Variable to Custom Block template file

I want to create my custom block with custom content in Drupal 8,in start I create Block with just simple text on it, and work correctly, my Problem is how can I pass my custom variable to it? I saw ...
2
votes
1answer
34 views

How to translate the search block title?

In Drupal 8.1.1 I am able to translate customs block and basic blocks (block type). The search block seems not to be translatable. But I need to translate the title of the standard search block. I ...
1
vote
1answer
23 views

Block visibily condition programatically

I want to display a block I implemented in a module when $_SESSION['Group_id'] is set. How can I achieve this?
0
votes
0answers
15 views

Blocks instead of content

I want to build a modular site, where some sections of a page are being reused as sections on other pages. The most suitable use-case I found is to have absolutely no page content, and instead have ...
0
votes
0answers
12 views

Create menu blocks of primary links that reflect another menu

I am using drupal 7 and trying to get a footer menu that reflects the main menu. I would like to find a way to slice the menu into blocks, but will still change to reflect the main menu. I have tried:...
0
votes
1answer
40 views

How can I display seveal menus with different classes

I have the "joy" to upgrade a Drupal 6 site to Durpal 8. In my Drupal 8 site I have three different menus, which each display different types of nodes. I want to display them in the region of the ...