Tag Archives: Drupal Theme

Drupal 7 – Create Zen subtheme using Drush command

1. Download the Zen theme

  • drush dl zen

 

2. Clear all cache.

  • drush cc all

 

3. Create the subtheme from the Zen starterkit.

  • drush zen “<subtheme name>”

 

Done =)

Reference: The drush zen command won’t work until cache is flushed

About these ads

Drupal 7 – Create your own theme function on your custom block

More than a year ago, we have talked about some basic theming in Drupal 6.

 

In Drupal 7, there is some changes on the theming functions as well as the block hooks. So here is a slightly modified versions from the example of Drupal – Introduction to Drupal Theming @ 3. The logic behind is exactly the same.

ykyuen.info
Continue reading

Drupal 7 – Override the .tpl.php in Advacned Forum

Advanced Forum has some default themes which are located @ sites/all/modules/advanced_forum/styles/<theme>.

Naked/Naked Stacked themes could be used for customization. So copy the .tpl.php which you want to customize in the sites/all/modules/advanced_forum/styles/naked folder to your theme folder.

For example, i want to customize the advanced-forum.naked.author-pane.tpl.php.
Continue reading

Drupal 7 – Customized comment.tpl.php for specific content type

The comment.tpl.php is located @<drupal-root>/modules/comment/comment.tpl.php. If you want to customize it for different content type. Copy it to your theme folder and rename it to

  • comment–node-<content-type>.tpl.php

For example, the machine name of Article is article. So the file name should be comment–node-article.tpl.php.

Done =)

Reference:

Drupal 7 – Strengthen the core Forum module by Advanced Forum

I am now working a new website project which includes a forum. With the Forum module bundled in the Drupal core. It is easy to build a forum based Drupal site. In the coming days, i would like to share suggestions when working on forum site.

First of all, you could equip your Drupal website with the basic forum features by enabling the core Forum module. However, that may be not enough for meeting the client’s requirements or it is difficult to customize it. That’s why we need the Advanced Forum module.
Continue reading

Drupal 7 – Apply sticky footer in Omega theme

We can make the section-footer sticky in Omega theme by adding the following piece of code in <your-theme>-alpha-default.css.

/* sticky footer */
html, body {height: 100%; margin: 0;}
#page {display: table; width: 100%;}
html>/**/body #page {height: 100%;}
*:first-child+html #page {height: auto;}
.section {display: table-row;}
html>/**/body .section-content {height: 100%;}
*:first-child+html body .section-content {height: auto;}

 

Kudos to Karl Kasischke.

Done =)

Reference: Has anyone tried to get a sticky footer to work with Omega?

Drupal 7 – Customize the user login block

In Drupal 7, there is a user login block. We can customize that block using the hook_form_FORM_ID_alter(). You can create a custom module or implement it directly in the theme template.php.

Here is a simple example written by Liam McDermott. You can add this in the template.php and replace THEMENAME by your theme name.
Continue reading