You are hereBlock
Block
Custom imagecache output of image
You are looping through some arrays and you have some image variable, path of original image. You want to print out some variation of that image, this is what you do
User_profile is imagecache variation and after that is variable where path of our original image is stored. I got that variable from a drupal view but you could get it in some block, or page file or wherever.
Get and loop results from view
You constructed a view and want to get view results and fine tune some usage of them by PHP this is how you get them
You will get classic array of values where you can choose which one you want to use and print out. You can also add name of display you want to use.
Block output and Views output in theme with module_invoke
Every now and then i need to make some custom output of a block, either in some page.tpl.php file or in a drupal interface custom block, either way you can get it with module_invoke function
Form Block and reference field
Form Block module enables you to create nodes from block, so you can have some text and under it block for entering data for node type lets use "tips". This is similar to commenting then but you can have much more power this way. But how then do you connect this new node with current on screen? You add to that "tips" node type a reference field, that would connect it to node on which this data was entered.
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
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!