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

learn more… | top users | synonyms

2
votes
2answers
23 views

Print just field data from a view into a block?

I'm trying to get a variable from a view to display on a block. For example "We have 200 blog posts" (200 being the variable). Right now I'm using the views_embed_view method. The problem is the view ...
1
vote
1answer
14 views

Theming blocks in Panels

Does anyone know of a module or some other way to allow users to customize blocks or panes (or even regions) in a panel on their profile page (i.e.: the authenticated user could change the color ...
0
votes
1answer
26 views

How to print a flag in a block programmatically?

I am creating a module which displays a block. I have created a flag within the module, and I am trying to display it through the block_view() hook. Currently struggling to get there... I am doing ...
0
votes
0answers
14 views

add code automatically for any article/post

I build a Drupal website with a customize theme, but in the last stand I need add a specific code after any post/article published on the site. For example: article 1 code article 2 the same ...
1
vote
1answer
25 views

Wrong caching of embedded views block

I am having trouble with the Cache API in Drupal 8. I embedded a views block with pagination through a field preprocess function into a node. When caching is off, I can normally use the pager and will ...
0
votes
1answer
19 views

Images placed in blocks do not show up on certain pages

I hope this is not a silly question. I have created some links to social media using images inside custom blocks. The images show up on every single page on my local testing server, but after ...
4
votes
1answer
45 views

Is it bad to add js and css in template_preprocess for a custom block?

If I load my page where my block is displayed as user 2 (any user besides user 1) my block displays correctly. If I reload the page my block doesn't display correctly and my js and css that was added ...
1
vote
1answer
14 views

blocks become hidden!

I created some blocks, and I assign them to regions for specific layout using context (and context_omega). now I can't see these assigned block in the admin/blocks. but I can see them being rendered, ...
1
vote
0answers
39 views

Blog contents not shown in custom theme. How to fix it? [closed]

I have purchased a drupal theme and installed it. In Bartik and other in-built themes everything works as expected. But if I set the purchased theme nothing shows in the client page. I have set the ...
0
votes
2answers
30 views

Using the Drupal 7's Block “description” field as a CSS class field

I need to add a css class to my blocks and I know I can install a module, but i rather not as it doesnt work with features. I was thinking of just using the block config's description field to hold my ...
1
vote
0answers
32 views

Drupal 8 static pages [duplicate]

How do i create Drupal 8 static pages that are translatable(3-lingual site)? I already have HTML code and about 15 static pages which some have dynamic content(latest news etc). What's the best ...
-1
votes
1answer
15 views

Difference between DRUPAL_CACHE_PER_PAGE and DRUPAL_NO_CACHE

What is the difference between DRUPAL_CACHE_PER_PAGE and DRUPAL_NO_CACHE? I'm developing a module that will generate 2 blocks for menu and it's sub-menu in different blocks and can't decide between ...
1
vote
1answer
65 views

Drupal 8 project structure

I was wondering what would be the best way to setup a Drupal 8 website that has about 15 mostly static pages in three languages? Static pages are somewhat similar but do contain different content. ...
0
votes
1answer
18 views

Insert code from module to .tpl [on hold]

I'm trying to insert a code (a button) from a module to a specific place in a view (between the filters and the array). Does anyone have an idea of how it can be done ? Thanks
1
vote
0answers
9 views

Archive block giving SQLSTATE[42000] error using views 3

I'm trying to make an archive block in views to filter my posts by year and month etc. I'm following a tutorial: http://chrisshattuck.com/blog/how-create-monthly-archive-block-drupal-blog-views but I ...
0
votes
1answer
22 views

Show block on nodes and only for node author

I am building a simple classifieds style site. Instead of using straight email, I was thinking about creating a simple "make offer" node type. Create a few basic fields (reference to classified ...
0
votes
0answers
16 views

file block upload

I am trying to create a page with a block that allows a user to upload an image file. I have downloaded & installed Block Upload which, from the example on the project page, should do exactly ...
1
vote
1answer
11 views

file as field node block

I am building a site in which authenticated users may upload files. When such a user is viewing URLs of a certain content type, I would like the left sidebar to contain, among other things, a file ...
0
votes
1answer
20 views

How do I check if a block region is empty?

I'm wanting to apply some specific CSS on the condition that a block region is empty. How do I make this check?
0
votes
1answer
27 views

Adding HTML just to a block

I've added a node as a block to my home page (using nodesinblock module). I've got it looking basically like I want it to look with the teaser appearing in the block, but I'd like to add a 'read more' ...
1
vote
0answers
7 views

How to refresh block view of flags when the flag list is empty? Link operations issue

I'm trying to have a simple block of flags for my site. I created a block view of content of my custom product type with a relationship to Flags: my_product (by any user). The issue is have is that ...
1
vote
1answer
19 views

Can you make a block appear only in a specific content-type

The natural option is to filter blocks by node ID's. I am looking for a way to filter it by content-types (i.e the block "roses in special prices!" will appear only at the content type "Flowers"). ...
1
vote
1answer
29 views

Is there a way to pass an argument to a view without using the url?

UPDATE: Shawn's answer is correct but I'd like to mention for anyone else looking to implement it. The arguments must match the contextual filters you've added, in the same order. Right now I'm ...
0
votes
1answer
8 views

Creating and updateable block on home page of site

I have a 'featured resource' block on the home page of my site. I'd like my very non-technical folks to be able to update this block with a new node every week. Note that it would just display the ...
0
votes
1answer
26 views

How to display block to the nodes of specific content type?

I have created a content type "test". I also created a block "Search". I like to display the block only to nodes of the content type. I configure the block and under Show block on specific pages > ...
1
vote
1answer
20 views

Exposed form in block not found in block view drupal 7

I am facing an issue what I need is expose some fields for search criteria & put these search boxes/drop downs to my sidebar, I didn't find the option "expose from in block" in the Exposed Form ...
0
votes
1answer
21 views

Print User Registration Block Through template.php file

I just want to print the user registration block through my template.php file without using the Form Block or Enabling php on my site to use this code: <?php if(user_is_anonymous()) { $form ...
0
votes
0answers
13 views

Create main page content block

I use drupal 6 and need to create main page content block - same as in drupal 7. I need it so I can reorder blocks that show on page. Without main content block I am not able to move some blocks over ...
0
votes
2answers
18 views

Suggestions for adding Advanced Search features to a block (using the dashboard)?

Is it possible to do the following: Add a Search box to a block through the dashboard? Have an Advanced Search on multiple fields in that block? Have the results of the search open in a new page? ...
0
votes
1answer
18 views

Why is my custom block template applying to all blocks?

I have a region on my home page called home_area_1. It contains several blocks. I want those blocks to be formatted in the same way, so I created a template called block--home-area-1.tpl.php. It is ...
0
votes
2answers
23 views

Views/Block: Only display if node field has a value

I've created a Block in Views. I only want this Block to display if a boolean field on the node is ticked. The View itself should only display content that relates to the node. How can I do this? ...
0
votes
0answers
15 views

(WAMP multi-site set-up) Why are symlinked folders causing blocks to be disabled?

First question posted here, so bear with me. I'm working with a WAMP setup, Windows 8.1 + latest Drupal 7.x. One of my installations is a multi-site with several sites hosted within. My problem ...
0
votes
0answers
11 views

Responsivness: blocks order + collapsible menu

I'm using standard Responsive Bartik theme because of its responsive capabilities, but I have one issue. When smaller version of site is displayed (phone, tablet,..), navigation menu (first sidebar) ...
0
votes
0answers
23 views

How do I make autocomplete dropdown with optgroups?

Has anyone been successful customize the autocomplete dropdown with optgroups having different icons with parent. i.e. I want dropdown hierarchical ways in search bar autocomplete.
0
votes
0answers
41 views

Adding Drupal Block Title to Bootstrap Accordion Panel-Title

Hello i am struggling to get my head around the best way to add blocks to a bootstrap accordion group. One way would be to look at creating a view that includes blocks and then rewriting the blocks ...
1
vote
1answer
87 views

Programatically render a block in a twig template

I need to render a views block in my page.html.twig template. In D7 I would do this: <?php $block = module_invoke('module_name', 'block_view', 'block_delta'); print render($block['content']); ...
0
votes
0answers
23 views

In Views how to group by year in an archive and then split into months

Views 3 - Create an archive for a given type grouped by year, then split in to months Node Type |-Year(2015) |-September (node count(12)) |-August (node count(15)) ... |-February ...
0
votes
1answer
21 views

Glossary mode on View Block disappear once a letter is clicked

I know how to attach Glossary mode into View page, based on setting here. I have tried to attach this mode into one of my block, but it does not seem to work. Is there a solution that work for block ...
0
votes
0answers
9 views

Send a Privatemsg in a Block?

I have user profile build with profile2 and I want user to be able to send a message quick (I'm using privatemsg to send my messages) once there are in the user profile. I would like to have a ...
1
vote
1answer
54 views

Are there Drupal 8 custom block type naming conventions?

With our ability to create custom block types and manually add additional fields in Drupal 8, is there a simple naming convention to create block--custom_block_type.html.twig to handle the layout of ...
-1
votes
2answers
30 views

Show cart block in pop up

I've installed Drupal Commerce module, I got show cart block in header. If I click on it takes to cart page. I need a pop up of cart page on clicking show cart.
0
votes
0answers
9 views

Cannot find a specifc node within panels

Drupal beginner here, running v6. There's a title I want to edit that I absolutely cannot find anywhere in admin. I found the text string in the panels_pane table SQL export on this line ...
0
votes
4answers
53 views

How can I load a block's subject and body, programmatically, for use in a module?

I need to create an array in my custom module that contains data from multiple blocks. something like this: array( 'block_1' => array( 'subject'=>'Block Subject Here', ...
0
votes
0answers
14 views

Has the Block Cache Settings from Drupal 8 been back-ported to Drupal 7?

I noticed in Drupal 8 there are options to cache a block: I was wondering if these options exist in Drupal 7 with a module? Has the feature been back ported? or was it a contrib module to begin ...
0
votes
1answer
23 views

Configure a block view via block settings

I'm developing a website for a comprehensive but not professional user. He has the permissions to configure blocks (in order to tweak minor things like ordering or so). Now I have a block view and I ...
0
votes
0answers
19 views

Create a related content block by date and taxonomy?

I have two content types, A and B. Both of the content types are tagged with terms from Taxonomy list C. Content A and B both have a date field (start and end date). When looking at Content A I want ...
0
votes
1answer
19 views

How to hide the configure slider in MD Slider?

I've installed the MD Slider, but I would like to remove the Edit Slider and Configure Slider links in the administrator role. What function should I use to remove that?
0
votes
0answers
14 views

Form action=“/cron.php”

I got a custom form in a block, wich is available on my homepage. After e while the form action changes to action="/cron.php" instead of action="/nl". I can't figure out where this fault is comming ...
1
vote
1answer
28 views

programmatically create one bean block to the default theme

I am trying to programmatically create beans in a custom module using entity_metadata_wrapper. This is creating a bean for each installed theme. (In Drupal 7) Is there a way I can create only one ...
0
votes
1answer
28 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 ...