By cohq82 on
I added this in mytemplate.info
regions[new_part] = "New Part"
And this in page.tpl.php
if ($new_part):
print $new_part
endif;
Now, I want to customize this region on block going into this region. How to identify the block I created using $block->delta in block.tpl.php. Or is there another way? because I am trying to create a new block and add it in the new region but I cannot customize this new block. I need a way to identify it in block.tpl.php so I can have customized code.
Thanks
Comments
Sorry the second code
Sorry the second code here:
Create the file block-[BLOCK
Create the file block-[DELTA].tpl.php and Drupal will use that file for that particular block.
It's basic templating :)
See http://yubastudios.com/blog/drupal-extending-templating for more examples of what you can do.
---
Yuriy Babenko
www.yubastudios.com
My Drupal tutorials: http://yubastudios.com/blog/tag/tutorials
---
Yuriy Babenko | Technical Consultant & Senior Developer
http://yuriybabenko.com
How to find out what [DELTA]
How to find out what [DELTA] is for that block?
Go to the blocks
Go to the blocks administration page and hover over the link to configure the block. You will see the block's delta in the status bar of your browser as part of the URL. In 99% of the cases it will be an integer.
---
Yuriy Babenko
www.yubastudios.com
My Drupal tutorials: http://yubastudios.com/blog/tag/tutorials
---
Yuriy Babenko | Technical Consultant & Senior Developer
http://yuriybabenko.com
Then I am confused because
Then I am confused because it showed block/7 so I create block-7.tpl.php but it didn't got used by Drupal. Any hint?
I'm assuming you read the
I'm assuming you read the part of the tutorial which talks about clearing the theme registry after creating new template files?
---
Yuriy Babenko
www.yubastudios.com
My Drupal tutorials: http://yubastudios.com/blog/tag/tutorials
---
Yuriy Babenko | Technical Consultant & Senior Developer
http://yuriybabenko.com
Yes, I did clear the cache!
Yes, I did clear the cache! Still ... hmm
Any way to troubleshot this?
Any way to troubleshot this?