Expanding Taxonomy Term data:Taxonomy Node or Term Fields?
So yo want to have additional data for your taxonomy term, maybe even a full blown node. There are 2 good solution
Views, passing argument from node taxonomy term
This code will be often used if you want to pass current node taxonomy term to view to list some other nodes, for example to have a list of similar nodes, nodes with same term. Choose taxonomy term:ID and write thise code down. We load current nodes data and get term ID from key of term.
$argum=key($node->taxonomy);
return $argum;
Printing out Node Variables nicely
You often have to print out node variables to see what you need to do. There are few ways to do that, before i used Drupal Themer for doing this which is part of Devel module. But this is very slow module and it takes a lot of time to load so i am not using it anymore. You can either use dpm function from devel module to dump something to screen nicely or just using plain old
Will get you printed node structure. So past that into your code, node.tpl.php or page.tpl.php.
User imports and Duplicat Emails
When you are importing user with Drupal, you probably do it with user import module, but you'll probably have a list of uses without any email or with duplicate emails, in this module its hardcoded that one email is used per person. However if you install shared emails module and do some hacking on current DEV version (2.x) you will be able to do that. In modules "supported" folder there is user.inc and go to line 235, there is a code that says
Same Email, different Username - What module?
It is the shared email module, that is the answer. As drupal permits one email per user, for testing purpose or site building with many users who didn't give you email address, this is very useful module.
Fastest way to edit files, change CSS etc
Fastest way i found to make small changes on your site is to use FTP program like FileZilla. Then you just go to file you want to edit and click view/edit. File is downloaded locally and opened in your default (or the one you set in FileZilla) editor. Then you just change what is needed and after all is done just confim on FileZilla that you want to upload changes.
Lightbox2, hiding flash content
Having problem with Flash when using lightbox for overlay? Just add transparency to those flash embed codes and they will be in the dark.
<EMBED src="swf.swf" quality=best bgcolor=#FFFFFF wmode="transparent" WIDTH="550" ...
How to print Description under the each Imagefield
So you put description for your images but there are nowhere to be seen? You or your client wants to have descriptions of images under each one. Well you will have to do some theming, in fact you have to create content-field.tpl.php and put it in your theme directory. And the code should be like this
<div class="field field-type-<?php print $field_type_css ?> field-<?php print $field_name_css ?>">
<?php if ($label_display == 'above') : ?>
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