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

learn more… | top users | synonyms

1
vote
1answer
19 views

How to create a module to allow for multiple instances of the same module with different variable parameters

How do you create a module to allow for multiple instances of the same module block with different variable parameters. I know how to create global parameters but that will apply to that block across ...
0
votes
1answer
22 views

How to add Visibility Settings option for node/content type

I have created a custom content type for campaign in my module using: hook_node_info() and add fields using: hook_field_group_info(). This campaign content type will be showing to user site wide ...
0
votes
1answer
16 views

Fetch a view into hook_preprcess_node and then put it in a block

I want to fetch a view in my template_preprocess_node function and then put in in a block, so I can diplay it in the sidebars of my page. I have the view (the code below) but don't know how to put it ...
0
votes
3answers
33 views

Can't find custom block php code in the database

I've created a custom block in Drupal 7, to display, in the upper right corner on every page, a menu that is context sensitive. Based on certain user attributes some functionalities are enabled or ...
0
votes
2answers
21 views

Creating node with multiple custom blocks, best method

What is the best method to create a node that includes multiple custom blocks with content related to only this node? The main concern is having a method that content editors will be able to ...
0
votes
1answer
26 views

I'm creating a custom module in Drupal, but can't get to my page. What am I doing wrong?

Here is the code I have so far. Just trying to get something to show up... going to www.drupalinstall.com/floor_map_page <?php require_once('includes/functions.php'); ...
0
votes
2answers
21 views

Why does my D7 User view only display 6 results in Block View, but all results in Page view?

I have a simple D7 view that lists all usernames and a couple of associated fields (business name, contact name) in table format. It has exposed filters on those fields, and about 200 users to list, ...
0
votes
0answers
13 views

How to execute a flag after uncollapsing/clicking a (block) item?

I have this code working as a dropdown menu block that shows user's notifications, with a notification count item to its right: <div class=notiwrapper> <?php global $user; //We get the ...
0
votes
0answers
12 views

custom block's BLOCK_VISIBILITY_LISTED not working on profile installation hook_install()?

Why this cannot work in my profile installation? array( 'module' => 'views', 'delta' => 'views-block', 'theme' => $default_theme, 'status' => 1, 'weight' => 0, 'region' ...
0
votes
2answers
37 views

How to show a link only if a node author has a certain role

I have a block with which I'm creating a menu for users <?php global $user;?> <a href="/user/<?php print $user->uid; ?>/ideabooks">MENU1</a> <a href="/user/<?php ...
0
votes
1answer
14 views

Zebra stripping each block in a region

I'm trying to apply this to each block in a region: http://figure-w.co.uk/zebra-striping-in-php/ He is generating zebra striping per div here, which is fine, but I'm wondering how I would apply this ...
2
votes
1answer
28 views

Does [Cache blocks] in Performance means that blocks generated by Views are also cached?

I am working on an old Drupal 6 project. My goal is to boost the performance of the website as much as I can. Among other things I have done, I have already enabled cache Configuration > ...
0
votes
0answers
21 views

How to do a block or region with repeating rows [closed]

I'm trying to create a block or region with repeating rows. The content can change inside the rows (and can contain anything from videos to text, to various boxes or input fields). There will be as ...
0
votes
1answer
20 views

How to copy blocks placement and settings between themes?

How can I copy blocks placement and settings between themes? I've found this module: https://drupal.org/project/blockregion and this code to do it in the database. But both are for D6. How can I do ...
0
votes
2answers
45 views

How do I make a custom block that has an image background with hotspots? [closed]

I am working on making a custom module with a block that contains a floor plan. It will be an office, when you hover over employees desks it will have a bubble appear showing that employees project ...
2
votes
2answers
74 views
+50

How to set nodes to be excluded from a block view based in the url of current node?

I have a view block listing nodes. Let's say I have the following nodes (it's urls) node/first-node node/second-node node/third-node node/fourth-node Then I have the view block listing this 4 ...
0
votes
0answers
19 views

D7-import View break blocks PDOExeption

I accidentally deleted a view in my D7 website. Good for me I had backup from yesterday, so I put that on my local drupal and exported the view. The View is getting added successfully but when i ...
3
votes
1answer
48 views

Is there any need to check the block name when my module just define a block?

I am reading "Drupal 7 Module Development", and I followed the book's steps to create a block in my module. /** * Implements hook_block_info(). */ function first_block_hook_info() { ...
0
votes
2answers
60 views

How to exclude current node from a block view?

I created a block view listing nodes of the content type: cars. I added the block to the second sidebar. After, I created 2 nodes of this type with the titles: car-1 and car-2. Then the view block ...
0
votes
1answer
27 views

why do I receive wrong Notice: Undefined index?

There is a view and content type both called activities and this is views-view-fields--activities--block.tpl.php <div class="element"> <div class="image"><?php print ...
0
votes
2answers
47 views

How to name a template file for the following theme hook suggestions?

I hardly managed it to create theme hook suggestions to work with different bean blocks, so I can use custom .tpl files like: bean--{bundle_name}.tpl.php // currently only bunde is 'zielgruppe' ...
0
votes
1answer
23 views

taxonomy term is not working

when i am added any query code is added in blocks our taxonomy term is not working they give two kind of errors: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'term' in 'where ...
0
votes
1answer
37 views

why do I get sql error when I click on taxonomy terms? [closed]

I am using custom code to display taxonomy terms in blocks: $tid=db_query("SELECT th.tid FROM taxonomy_term_hierarchy th INNER JOIN taxonomy_term_data td ON th.tid=td.tid INNER JOIN ...
0
votes
1answer
22 views

Making menu wrapped in nav tag

I've got problem with making main-menu wrapped in element. I've tried: Using hooks in template.php like: function koko_menu_link_main_menu($variables) { /* For block override */ $output = ...
0
votes
1answer
23 views

How to link taxonomy term with its content?

This is the code below that i am used $ch=db_query("SELECT th.tid FROM taxonomy_term_hierarchy th INNER JOIN taxonomy_term_data td ON th.tid=td.tid INNER JOIN field_data_field_books book ON ...
0
votes
2answers
26 views

How to link taxonomy term with current loaded NID?

I want to link taxonomy term with current loaded node I am using $nid = arg(1); $term=taxonomy_term_load($tid) print $term; but noting happened. Please tell what is the correct way
0
votes
0answers
14 views

Data Attribute added to block from Content Type field

So this is a very complex series of questions. I am brand new to module development (and PHP for that matter). I have a content type called "Parallax Block" with 4 fields: a title, an image, a ...
0
votes
1answer
16 views

how to get top parent of terms using taxonomy get parent

i have these taxonomy terms in this form term A -term B --term c ---term D i want to get term A on every node page i am using $nid=arg(1); to load tid of the page. working in blocks
0
votes
1answer
19 views

A views page as “Output this field as a link” in a block (Drupal)

Hello I´m trying to get a link from my thumbnails gallery http://www.nellens.com/home/photos to the full size gallery http://www.nellens.com/home/photos-full for each "Photo" content type that I have, ...
0
votes
1answer
30 views

How to use “taxonomy_get_childern” function

//TID of current loaded node <?php $nid = arg(1); $tid1 = db_query("SELECT data.name,data.tid FROM field_data_field_books book INNER JOIN taxonomy_term_data data ON data.tid = ...
0
votes
1answer
38 views

drupal_get_path() not working in subdirectories of my site

So I'm using drupal_get_path() within a block to reference an image in my themes//images directory. And this works. At the root and all first level pages. example.com, example.com/about, etc. ...
1
vote
1answer
20 views

Fix/force blocks in a region inside a tableDrag

I'm trying to alter/patch/hack node_level_blocks (like the admin blocks overview page) so that some users are restricted in choosing regions for certain blocks. For instance the "New Content" view ...
0
votes
1answer
28 views

How to run <script> code in a block

I'm trying to utilize some pre-built code to display data in a Block. Specifically, show a crude oil price quote in a block. On oil-price.net, they give you code to embed on an HTML site to display ...
0
votes
1answer
15 views

change where Authoring information and Publishing options Checkbox is displayed

Currently Authoring information and Publishing options have options within their own how do you call it "tab/page". Example: When you edit a page you have to click Publishing options in order to see ...
2
votes
1answer
49 views

How to call site name in PHP block?

I have a block in my footer that I currently use to display a copyright message using PHP, like so: Copyright © <?php echo date("Y"); ?> I'd like to add the site name to that code snippet, ...
0
votes
1answer
11 views

Blocks in panels don't get updated in features

I added Features extra and created a feature with the block I created, added it to a panel, exported the block feature and panels feature, but it won't appear in the target server. The Block does ...
0
votes
1answer
23 views

How can show block when mouse over icon in menu

How can show block when mouse over icon in menu like this when i put mouse in any link in this menu its show me block. How can i do this.
0
votes
1answer
21 views

ImageBlock Module- Responsive/Fluid images

I am using the ImageBlock Module to upload/insert images into a block, which works great! However I am designing a responsive/fluid website. I have no problem with this if the image is stated in CSS, ...
0
votes
0answers
98 views

Add Bootstrap Carousel to Region

I am creating a custom front page (using a template page--front.tpl.php). I've defined a few regions to be used on my front page. In one of these regions I would like to embed a Bootstrap Carousel ...
0
votes
1answer
97 views

How to display article from category and show it in block

I have created a content type which has some fields, and I want these fields to be displayed as a block. I need to display some article like 5 articles from category called sport news only. how can ...
0
votes
0answers
7 views

Get the list of available regions in Add Bean Block page

I am using beans to add custom blocks. What I am doing is first add a custom bean block and on second step goto /admin/structure/block page and select the region where that bean block should appear. ...
0
votes
0answers
7 views

login not showing on home page, drupal 6

am making my site in Drupal 6, for some reason the main page, the right sidebar has no blocks! i don't understand, because i have configured the blocks to show on the home page. can i be missing ...
0
votes
2answers
14 views

Drupal 2 blocks same form function with different output not working

I have dynamically created some blocks depending on how many entries I have in the database: function my_module_block_info() { $result_set = db_select('my_products', 'products') ...
0
votes
2answers
28 views

Field Collection Views and Blocks

I've assembled a content type with a Field Collection (image, text and link). I installed the Field Collection Views module and duplicated the view it came with. I added a block display to the view ...
0
votes
1answer
52 views

How do I programatically create a Bean 'instance' in code?

I am trying to make a sort of hook_setup_beans() function (similar to hook_setup_blocks()) to create some bean instances by default when a user turns on a bean_example module I am making. This would ...
0
votes
2answers
26 views

Accessing field inside a block

I have created a block to display flash content. All it needs a a variable to be assigned dynamically from the content to flashVar. I created a field called myfile path in the custom content type. ...
0
votes
0answers
7 views

Search Form in separate regions depending on template

I have the search form to display in First Bottom region but on the front page I want the search form to appear in the first sidebar. We can't clone blocks so I don't know how to get his done! I am ...
0
votes
0answers
30 views

Main menu does not display on pages with a specific path

Having a really frustrating problem with my Drupal site. On pages that have a specific path the main menu block does not load. For example I have the path.. meet-our-derms/bios meet-our-derms/test ...
0
votes
1answer
25 views

Transforming system link into a button

I have created a "button" class in my style.css file. I can easily create a button by assigning the "button" class to it. I can do this when I write the html code in, say, a block that I place ...
2
votes
2answers
71 views

How to add <script type=“text/template”> in drupal?

I'm using underscorejs function _.template() to render html on client side. I found that in many examples, the templates are placed in some <script type="text/template" id="id"> on the page, and ...