I have been trying for quite a while to customize blocks individually within marinelli and I just can't seem to get it to work. I have no problem with drupal core themes and I want to know if this is possible within marinelli. Here's my situation:
I create a block and I want to theme it seperately. Let's say my block selector is 15. I thought I could referance the block with #block-block-15, but it does'nt work. I've looked into the block.tpl.php and I see the defaultblock and blockcontent classes, but changing them changes all blocks. I just want to theme one block individually. Is this possible in marinelli and if so how?
thanks,
wim
Comments
Comment #1
Lioz CreditAttribution: Lioz commentedall blocks use the same container. if you want to customize a particular block you have to edit block.tpl.php with conditional statements: for example: if you have a block with subject=example you can use this code
then you have to create a block-example.tpl.php with the html code you want to use
let me know if this solves your problem.
Comment #2
battochir CreditAttribution: battochir commentedBingo! Thank you Matteo. I was a bit confused by not be able to call blocks by ID, but rather title. Now it's clear to me. I can call any block by simply referencing the title. Problem solved. Nice. I appreciate your help with this.
ciao,
wim
Comment #3
Lioz CreditAttribution: Lioz commentedok fixed ;)
Comment #4
(not verified) CreditAttribution: commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #5
PepeMty CreditAttribution: PepeMty commentedsubscribing
Comment #6
mikeytown2 CreditAttribution: mikeytown2 commentedChange block.tpl.php from
<div class="defaultblock">
to<div class="defaultblock block-<?php print $block->module; ?>">
. Line 2Comment #7
jcnventura CreditAttribution: jcnventura commentedThis is actually a problem in Marinelli not following "core".. Why didn't you copy Garland's block first line:
This provides a simple way for themers to identify and theme each block without having to create their own block.tpl.php, or to add extra lines to the file provided by the theme.
Comment #8
green monkey CreditAttribution: green monkey commentedthank you all for this post :))
Comment #9
green monkey CreditAttribution: green monkey commentedI ended up moving the code up above the h2 - so I could theme the h2 block too
again thank you - I was so frustrated with the darn blocks - wow - do I have control now :))
Comment #10
dafederAgreed - no reason not to provide a way to style individual blocks out of the box!
Comment #11
Katrina B CreditAttribution: Katrina B commentedSubscribing; I was looking for this functionality as well, and I would like to see it become a permanent part of the theme.
Comment #12
tedfeely CreditAttribution: tedfeely commentedI'm a newbie to Drupal and a notbie (not at all be) to PHP and am trying to get Marinelli blocks to drag and drop.
I replaced Marinelli's block.tpl.php script that follows:
. . . with the suggested code listed above:
And, am now getting ubiquitous error messages that say:
Notice: Undefined property: stdClass::$content in include() (line 47 of /home/romeapar/public_html/modules/block/block.tpl.php).
Line 47 is:
print $block->content;
Any help correcting this will be most appreciated.
Comment #13
oadaeh CreditAttribution: oadaeh at Flatt and Sons commentedThis issue is being closed because it is against a branch for a version of Drupal that is no longer supported.
If you feel that this issue is still valid, feel free to re-open and update it (and any possible patch) to work with the 7.x-4.x branch.
Thank you.