The default templates and themable functions contribute a good deal to the productivity on a Drupal site, and several are positioned on the page through the assignment of blocks to regions. Today we will focus mainly on how to control the formatting of a site’s various modules and blocks.

1. Dynamically Styling Blocks:

Block output is controlled by the block.tpl.php template. As in other areas, PHPTemplate will look to the names given to multiple template files to determine which template to display. The order of precedence used for the block template is consistent with that used elsewhere.
• you can provide a template to apply to the blocks of a specific module of a specific delta `(block-modulename-delta.tpl.php)`.
• You can also attach a template to blocks of a module by module name `(block-modulename.tpl.php)`, or to the blocks of a particular region `(block-regionname.tpl.php)`.
• If nothing is specified, the system applies the default `block.tpl.php` template.
If you are not certain of the attribution of your block, that is, the name of the module that produces the block or the block’s delta, try using the Theme Developer feature of the Devel module. If you have the Devel module installed on your site, you can yield information in the form of a list of suggestions quite effortlessly
• Install the Devel module.
• Activate the Theme Developer option.
• Open your browser and go to the page where your block appears.
• Click the **Themer Info** checkbox on the bottom left of the screen, then click on the block in question.
When you click on the element, a pop up will appear:


2. Dynamically Styling the Forum Module:
The base template of the forum module is `forums.tpl.php`. There are several suggestions for both forum containers and topics:

3. Dynamically Styling the Polls Module:
The Polls module is the subject to a number of default templates. There are default suggestions available for all the key templates:


4. Dynamically Styling Nodes:
PHPTemplate provides an explicit template for nodes—`node.tpl.php`. In the absence of a more specific template, the system will apply the default `node.tpl.php` file. The table below shows the suggestions for the default system:

  • Share/Bookmark
Tags:

In drupal the form is rendered using the form rendering system, which doesn’t include template files.
To theme the profile 2 form we use “hook_theme()”.
Go through the steps:
1. In this step copy the code in template.php of the theme or any php file and include the file in template, php used with proper theme name and form [...]

  • Share/Bookmark
Tags:

Google Calendar and similar other online calendaring applications provide simple centralized systems, where online communities can maintain event calendars and community members can extract information about upcoming events. But many organizations prefer to display event calendars on their community portals, forums, or blogs. They often copy event calendar information from online calendaring applications onto their [...]

  • Share/Bookmark

Today we will learn a few interesting things about SQL Query Optimization.
How to get query execution time and executed query number?
Follow the code given below:
function timer()
{
$time = explode(‘ ‘, microtime());
return $time[0]+$time[1];
}
$beginning = timer();
$timer_queries += round(timer()-$beginning,6);

The sql query becomes faster if you use the actual columns names in SELECT statement instead of than ‘*’.
For Example: Write [...]

  • Share/Bookmark
Tags:

We can see various type of password strength meter when we are registering on different types of websites. Here I will show you how to create a simple password strength meter using JavaScript and PHP.
There will be three steps:
1st create a html form:
{form method=”post”}
{h1}Password strength meter{/h1}
{label for=”pass”}Password{/label}
{input type=”password” name=”pass” id=”pass” onkeyup=”passwordStrength(this.value)” /}
{label for=”passwordStrength”}Password strength{/label}
{div [...]

  • Share/Bookmark

Meta tags are HTML codes that are inserted into the header on a web page Meta tag helps Google search simpler. The word Meta means information about.  Meta tag gives information inserted into the “head” area of your web pages. Meta tags, for example, can tell a browser what “character set” to use or whether [...]

  • Share/Bookmark
Tags:

Here are 9 of the top 52 tips on how to optimize your website for its turbo-charge rocket ride up the search engine rankings.

Be bold: Use the <b> </b> tags around some of your keywords on each page. Do NOT use them everywhere the keyword appears. Once or twice is plenty.
Deep linking: Make sure you [...]

  • Share/Bookmark
Tags:

Cross browser compatibility is an option to test the compatibility of your web site among the oceans of other sites. There is a possibility of surfing out your web site from browser as for their wish or else lack of effectiveness in the web site. This is written for designer and developer to over come [...]

  • Share/Bookmark

For a fresher joining an almost unfamiliar sector is kind of amusing and that’s why I felt giddy when I was first joined Codez on 25th of April 2011.I still remember my interview vividly and am still not sure how on earth Navin thought I could join the company…trust me it was disastrous.
Now let’s get [...]

  • Share/Bookmark
Tags:

While doing a new project on Wordpress, I come across a situation which required a custom menu bar to be showed inside page content. I can’t make it hard coded because the client needs the dashboard edit page option for that page to update the content. I thought there should be a plug-in to help [...]

  • Share/Bookmark