Krishna Gupta
Krishna Gupta

Reputation: 685

How can identify that which blocks are calling on a particular content type in drupal

I have a website which is developed in drupal cms and i am newbie for drupal. I have setup whole website on my local host, and i'm debugging like that :

* Checked calling theme function,
* Checked activate theme page.tpl.php file
* Checked module which is called on content type.

But i can't get anything which become helpful for me. So please help me thanks in advance.

Upvotes: 0

Views: 42

Answers (2)

MilanG
MilanG

Reputation: 7114

If blocks are placed on page from back-end 2 most common options are:

  1. Placing a block on admin Blocks page (Structure -> Blocks). Here blocks can be placed to some regions, but in block properties some exceptions can be set, i.e. placing block only on some content type, or only for some user group or similar.

  2. Blocks can be added with Context module - check if you have it running - Structure -> Context in admin menu.

Upvotes: 0

Tim
Tim

Reputation: 485

Drupal is known for having a pretty steep learning curve. Don't get discouraged when you are learning it!

To find out what template files and hooks are being called for specific blocks, regions, etc. of a theme, you can use the Devel and Theme Developer Modules (Theme Developer requires the simpleHtmlDom API Module):

Devel: https://www.drupal.org/project/devel

Theme Developer: https://www.drupal.org/project/devel

simpleHtmlDom API: https://www.drupal.org/project/simplehtmldom

Be wary of the version of simpleHtmlDom you install, Theme Developer only works with 7.x-1.12.

Once you've installed and enabled these modules, you will see a checkbox in the lower-left of each page. Upon checking said checkbox, you can then click any element on the page and an "info box" will be displayed with tons of debugging information:

Drupal Theme Developer Screenshot

In the sample I've included above, you can see that this element is defined in a function called theme_links(). One function name you can use to override in your theme is: minnelli_links (in this case, the theme used in this sample is "minnelli", hence minnelli_links() would override). The available variables to the function are also listed (this is where you are likely to find some information about the Content Type that is used to populate a block).

This is a great tool for debugging Drupal themes. Give it a try.

Upvotes: 1

Related Questions