IE stylesheet Limit

There is a "31 stylesheet limit in IE 6 & 7" so sometimes your page will break in this browsers. You will go crayze, asking yourself whats going and, checking CSS and tags. But all you need to do is put under performance, CSS to optimize and you will have one stylesheet and will have this problem fixed.

Node loading, simple variable passing to flash banner

So in previous post with made drupal custom block now lets make custom block with flash banner where data to banner is passed from node that has CCK fields.Make content type with 4 cck text fields, or just use one field, even body can do and then you can manauly manipulate string with PHP, just have some separator in your input. In this example we will use 4 cck fields.So in the block template, block-block-4.tpl.php we add this code

<?php $nid='51';$node = node_load(array("nid" => $nid));?>

Custom block

Sometimes you want to customize block more then its available through drupal admin, then you start themeing. Quickest way is to copy default block.tpl.php file and then edit its name to something you want to customize. Lets say we customize block number 4, which is block created with views, then you make your file name like "block-block-4.tpl.php" and then change its content. For this to work you have to have block.tpl.php also in your theme folder.

You can dowload php file like that below!

Anatomy of perfect landing page

Sometimes i will post just interesting things for web design in general. For example, this is good link with visual how your front page should look. Unfortionatly not much drupal themes look like this. I only know of this two
Danland and Bluemaster, give some comments if you have more suggestions and ofcourse you can always build your own, i suggest zen of fusion starter themes.

Link to us, banner creation for other sites etc

I usually did this with views, custom content type etc, now there ia module for this

http://drupal.org/project/link_to_us

You'll probably still have more power with views and node types but this is a very good quick solution.

Glossify Internal Links Auto SEO vs Link Inteligence

Both of this modules are still work in progress but you can make good use of them. Currently Glossify is my favourite because it links to taxonomy terms when needed. Link inteligence has maybe a bit better perspective and whole architetture behind SEO Tools module looks very promising but when you use it you won't be satisfied so much with results and links it makes, although there is high level of customization present and also bulk generating of links.

Remove new comments link in links section

Often you want to remove something from links section of nodes, best way is to intercept it in template.php and use UNSET on it, for example look here:

 

function phptemplate_preprocess_node(&$vars, $hook) {
  //drupal_set_message('<pre>' . print_r($vars['node']->links, TRUE . '</pre>')); // print what links are available   unset(
    $vars['node']->links['comment_new_comments']
 );

Use first image in imagefield gallery as teaser image or headline image

When you create imagefield gallery you can easily use first image to set it as teaser image if you use Views and Fields for row style but if you use NODE than you have a problem. Also with views you usually override or make lists of nodes but for full node display you need to use something else like Panels, or you can also try overriding nodes with views but that's not best practice. After trying Display Suite, Panels etc easiest way to achive this is through Contemplate, you edit your teaser like this

 

Great way of theming taxonomy lists in teasers

As there is not much options to manipulate teasers and especially taxonomies in drupal you should use this code in template.php

CSS for iphone

When you decide to make page for iphone, or maybe just make additional css to change how its views on iphone you should add this code, as iphones ignore other code. With this you set it depending on the size of the screen, so you hide sidebar for all devices that have screen smalled than 480px (widescreen iphone format). More info can be found on linke below

You can specify that a set of CSS rules apply only when the screen is smaller than a certain resolution: