Posted by OnkelTem on March 7, 2010 at 5:57pm
Hi all!
I have a design, where blocks may have an icon in its header.
I think the best solution would be having an upload file filed on a block editing form. Is there a module with such functionality?
If a block has an image uploaded, then vertical space is allocated BEFORE block title (to place the image there). So I need also a theme variable (with an image) when theming a block.
UPD. Note to readers, look at http://drupal.org/project/skinr module!
Comments
Since each block has a unique
Since each block has a unique id as well as some classes I would just use css to attach a background image.
A customer has no CSS
A customer has no CSS knowledge and would like to edit eveything using regular editing forms.
Do they edit blocks?
Do they edit blocks?
Yes, they do. When I finish,
Yes, they do. When I finish, no further cooperation is planning.
If you can use a fixed set of
If you can use a fixed set of images, you could use Block class, set up predefined classes that associated the images. Otherwise I suspect you will need a custom module.
Yeah, thats why I'm asking. I
Yeah, thats why I'm asking. I can't find appropriate module :)
Here is an image,
Here is an image, illustrating two different block templates - with icon, and without it:
http://www.onlinedisk.ru/view/371809
How many icons are you
How many icons are you thinking of? There are three things I can think of to do:
- Use the Skinr module to create a few different "skins" that the content editor can choose from. Each skin you choose could have a different icon in the top of the block.
- Accomplish something similar with the Block Class module - so they can state a class on the block that will apply one of the images to the header. (Same as suggested above, and less complex than the Skinr option).
- A lame solution might be to allow the editor to add images in the block with IMCE and then use CSS to force the image and the title into the proper place. This would probably be a nightmare to maintain - you would need to use CSS also to force the images to be the proper size, since it wouldn't be handled with Imagecache this way. I don't recommend doing it this way - there would be too many things that could go wrong...
Amanda
mndonx, thank you very much!
mndonx, thank you very much! I didn't know such handy modules exist!
Yeah, the set of icons is limited, I just need a way to associate them with modules and let the customer to easily choose.
Skinr is pretty good, not to say its best solution in this case, but I look forward to use Skinr in future projects.
How could I missed this module before?!
Thanks again!
Block Icons
I just released the Block Icons module that does exactly this. May be helpful for anyone coming across this post in the future...