Questions tagged [blocks]

In Drupal, a self-contained collection of content and functionality that is displayed in theme regions is called block.

Filter by
Sorted by
Tagged with
0
votes
1answer
958 views

View in views header still displaying when no result

I tried this question: Empty view is rendered even though there is no result And it didn't work I have a view of Judge nodes that displays using a contextual filter. Inside that view I have embedded ...
0
votes
1answer
31 views

Why is the Aggregator module not creating a block

I am using the Aggregator module that is part of Drupal 9 core. I am following the docs on drupal.org: https://www.drupal.org/docs/8/core/modules/aggregator/overview After I create a feed and update ...
0
votes
1answer
485 views

Dynamic content with a view and a block

I'm new to Drupal (using Drupal 8) and have been struggling to get content from a block I've create to display when accessing the view. I've created a "service" view (page) which lives at the path "/...
0
votes
2answers
41 views

How to cache View block by content language?

I have a very simple (block) view to list a node's title. This view has an id from url contextual filter and a single filter to filter on Content language set for the page (by URL prefix). This block ...
2
votes
4answers
2k views

How to create custom theme a view

I've defined a view with the CCK and Views modules. I have two ways for printing the result: As node content As fields content If I choose node content, I need to choose the view mode, which by ...
0
votes
0answers
14 views

Does Views block caching include language in cid?

I think this is likely a core bug (in which case I know it is not meant for Drupal Answers) but thought I would check here first to see if possibly I have just missed something in configuration? I ...
0
votes
1answer
51 views

Custom Module Rename

We have three custom pieces of code for our Drupal website: module, theme and a non-drupal php library. The names of these components have become awkward over time. I would like to rename our custom ...
2
votes
1answer
2k views

Quicktab problem on the argument of view and block

I used to make a view shows a page of a project in the url: projects/[node:author]/[node:nid], this view works well. Now I want to display this view in the quicktab, but the problem is I can't view ...
0
votes
1answer
25 views

How to change the condition to AND in accessing content by role in a view-block?

I have a view-block 'Expo', I want to display this block only if current user has two specific user roles i.e., 'Actor' and 'Singer'. When I checked the both 'Actor' and 'Singer' , The block is ...
0
votes
1answer
408 views

Entityform (block) redirect not working

The redirect field within entityform doesn't seem to have any effect. I'm using the entityform block module, if it makes any difference. I have also tried using hook_form_alter to copy to default ...
1
vote
1answer
463 views

Adding a subtitle to the main title

My Website name is Subham Soni. I want to add two more lines below it. One as "Developer" and then in another line a quote along with the author. How do I do it?
1
vote
0answers
16 views

How to refresh/rebuild block without reloading the page?

I have a custom block which displays the number of events added to favorites(Flag module). I am using the TWIG template to display those results. I want to refresh the block contents right after the ...
0
votes
1answer
734 views

How do you override custom blockAccess() methods for blocks added with Page Manager?

I've created a custom block with all its methods like blockAccess() etc. I would like to override one of those in another module. In my project I have used Page Manager, means I think I can't call ...
0
votes
0answers
10 views

How to word-wrap field label from a view

I'm still new to Drupal views, how do I word-wrap a field label from a Drupal view? I know there are style settings within the field and there's one called, "Customize label HTML". Do I just ...
0
votes
2answers
543 views

How do I add a template suggestion for a Views block?

I am very much so new to Drupal and have moved to this platform after working with Magento for 5 years. I am trying to create a template for a view. I have created the twig template under /templates/...
1
vote
1answer
707 views

Add views block to views header

I want to have the views header elements after exposed filters, so i try to get the filters in the header. For that, i expose them in a block, and try to add that block to headers, but no success. I ...
0
votes
1answer
316 views

Menu block doesn't appears where I expect it

I have this kind of menu: "Level 1" has menu item "Level 2", which links to the page with "cat1" url. Then, I have node which have aliases "cat1/[nid]", hence, in my opinion, menu block (provided by "...
4
votes
2answers
16k views

How to use the managed_file field in a custom form plugin

I'm attempting to create a module with a custom form that allows users to upload a file using a managed_file field. The name of my module is foundation_settings and the file structure is: ...
0
votes
0answers
23 views

Better exposed filter for block view doesn't appear

I created a new content type and a display page to show a listing of all my new content type pages. I'm trying to create a better exposed filter block on my page for the sidebar, but when I try to add ...
1
vote
1answer
942 views

Block is not showing up in a custom taxonomy page template

I am using Drupal 7 I have a content type courses. I have a page folder in template folder, with courses.tpl.php file. When i go to courses page it is showing contents from courses.tpl.php. Issues is ...
1
vote
1answer
2k views

How do I add classes to blocks?

I am using Drupal 8 Panels and it is working fine. The problem currently I have is, that I want to add classes to individual blocks on the panel layout page. Is there a way to add classes to blocks on ...
1
vote
2answers
634 views

Adding block in view tabs

I have tabs created using views and has contextual filter of group parent(Group ID from URL). I created a block that has a contextual filter of GID. In the block layout, I placed the block in the ...
0
votes
0answers
73 views

--2 is appended to the block ID

I have a strange problem. After upgrading a website from D8 to D9, some of my block IDs are changed. Some of them now have --2 behind the ID. This is messing up my styling and scripts. And I'm ...
1
vote
1answer
452 views

Blog monthly archive block - list of posts grouped by year then month

See the implementation on this guy's blog: http://deglos.com/blog YEAR -- Month -- Month YEAR -- Month -- Month Anyone know how this was accomplished?
1
vote
1answer
409 views

How to remove custom block parent div's?

I have created custom block in my custom module. I have created block template file into module templates folder. Custom block content coming successfully as per given in block__MODULENAME__dummmy_xyz....
0
votes
1answer
403 views

Export blocks added as default content

I am using Layout Builder to add blocks into my nodes. I am adding several instances of different custom block types to specific content individually. I wander if it is it possible to export those ...
2
votes
2answers
41 views

Get the time a custom block was last edited

I have seen lots of answers for getting when a node was last edited, but I can't seem to apply any of these methods to blocks. Basically, I have a block that I only want to display if it has been ...
0
votes
0answers
5 views

How to display group operations block not in a dropbottom menu either "normal" links list/HOOK_block_build_group_operations_alter does not fire

currently the links of the "group operations block" of group module are displayed in a dropbutton menu. I want them to get displayed in a "normal" link list. I found an issue (...
1
vote
2answers
107 views

How to add class to multiple view-blocks using twig?

I have four blocks to a view. I want to add class 'fancy-body' to all four blocks. How can I add that. view_id : categories display_id's of blocks : block_1, block_2, block_3, block_4 I know, I can ...
0
votes
1answer
357 views

How can I get the current node view mode and add to block template suggestion?

In my code, I need to get the current view mode of the node to be able to pass it to be used as a block template suggestion. The function I have set up is able to grab all available view modes, but I ...
2
votes
3answers
2k views

How to display a block if a Boolean on/off checkbox is checked?

I will eventually install Panels to accomplish this. But I can't at this time. I want to allow an editor to display a right sidebar menu on any page when they want by checking a Single on/off checkbox ...
0
votes
0answers
58 views

How do I prevent a block from being loaded via Big Pipe

I have a view block, nothing crazy, just a couple fields. I want to present it as a carousel. Everything worked fine, until suddenly Drupal decided to start loading the block asynchronously with Big ...
2
votes
2answers
859 views

How can I show/hide a block on specific taxonomy URLs depending on term depth?

I need to show blocks on different url's. Block1 Should be displayed on: branches/taxonomytermlevel1 But not on branches/taxonomytermlevel1/taxonomytermlevel2 Block2 Should be displayed on ...
1
vote
2answers
396 views

Is there any way to force a custom block in the Custom Block Library to invalidate cache on edit update?

I have created custom blocks in the Custom Block Library and placed instances of the blocks on a page in Block Layout. The blocks get cached for anonymous users. Editing the custom block and saving ...
5
votes
6answers
6k views

How to hide an exposed filter block if the view results are empty?

I have an exposed filter block on the sidebar on my page. I want to hide the exposed filter block if the result of the view is empty. What is the best was to do it ? Right now i am having some Jquery ...
1
vote
1answer
393 views

How do I add a more/less link in block?

How do I add a more/less link to drop-down and roll up a block? I have a custom search block with a lot of field items and as such, the block is so long. I want to be able to add a more link to drop ...
0
votes
2answers
397 views

recent content block with thumbnail?

I want to theme the Recent Content block with associated thumbnail of each node. After researching for a long time I found the function node_get_recent(). This function selects data from table 'node', ...
-3
votes
1answer
62 views

How to track recently viewed nodes using JavaScript on a completely cached website?

I want to make a block of recently viewed nodes on a website which is completely cached using Boost module (it saves a static HTML page for every request on the website). I don't want to disable Boost ...
3
votes
2answers
717 views

How have multiple instances of a Custom Block?

So I have a custom block that has been created within the module. I have used the drupal API to generate the brand new fields - which works perfectly. However, I am having an issue regarding multiple ...
0
votes
2answers
696 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} ; ...
0
votes
1answer
374 views

How do I allow facets on my full content display page?

I have installed Kickstart Commerce 2. I have been able to allow facet searches on my collection pages, by simply adding collection/* under the "Show block on specific pages" section of the blocks ...
0
votes
1answer
1k views

Update the block through ajax

I have added a block which shows the no of items added to an entity. I want to refresh the block through ajax as the items are added to an entity through ajax form so whenever I add an item, it will ...
0
votes
4answers
2k views

How to add page restrictions for blocks in drupal?

I'm using the drupal administrator menu for the settings there i have a page called /desert/234234 the block should appear only when the url is /desert/(desert_id) how can i restrict that
3
votes
1answer
89 views

How to setup access dependency on a block content created programatically

In Drupal 8, I am creating block instances (BlockContent) for node layouts programatically and setting them all as non-reusable. That causes a following access error: "Non-reusable blocks must ...
0
votes
1answer
1k views

$.cookie is not a function from form.js with block cache

I am getting this error if I turn my block caches on. I have traced back the origin back to Drupal core form.js but can't seem to see what's going on here. Any ideas? Here is the debug: form.js?v=7....
0
votes
1answer
41 views

Webform block shows for anonymous user but not authenticated

I am using the webforms module (6.1.1) on a Drupal 8 site for a form that shows up in a block on my front page. If I am not logged in (go Incognito or InPrivate mode) the form displays and works. If I ...
0
votes
1answer
395 views

Specifying parameters for block_load

UPDATE: Following Shawn Conn's advice I was able to render a specific block changing $res_output = drupal_render($res_output); to $res_output = drupal_render($output); But I'm still unable to ...
0
votes
1answer
415 views

How to display specific blocks for specific roles alone w.r.t domains and subdomains

I want to display specific blocks for specific roles alone with respect to domains and sub-domains. I know i can give permission for roles in the block to be displayed.How do i differentiate anonymous ...
2
votes
1answer
503 views

Problems with active-trails

I have played with Menu Trail by Path and Menu Position, but none worked well with a Views-generated listing acting as a navigation menu. Imagine the following scenario: On the left side there is ...
0
votes
0answers
19 views

How do I dynamically add filters?

I have a view_block with the following filters, I want to change the product tag, Release tag, Document type values dynamically based on url. if the url is, example.com/mars/21.43.00/ProductGuide, ...

1
2 3 4 5
57