To style my images, I am using border, margin and padding properties. For border and margin I can use the interface that comes with this module. But I can't add padding. If I add it to the css it gets overridden even each time I change something in a panel pane that pulls the image. You say this:
This CSS File is automatically generated by the imagefield_gallery.module, any
edits made to this file will be overwritten the next time any configuration changes
are made via the admin. If you'd like to alter the contents of this file, check
theme_imagefield_gallery_css_render() in the imagefield_gallery.module file.
But I still have no idea where I would add the padding, as I am not familiar with php... Any help would be greatly appreciated.
Otherwise I am absolutely loving the module and how it works!
Comments
Comment #1
eclipsegc commentedaschiwi
This is controlled through the theme function interface of drupal. If you're not familiar with theme functions they're any function that starts "theme_" In our case we have a theme_imagefield_gallery_lightbox2_css (or something like that, my next version changes all the names...) anyway... point being in the theme you use for your website there's a template.php and within that file you can over ride these theme functions. Imagefield_gallery makes use of theme functions to build the css, so if you REALLY need to access the padding for something, you could rebuild your own theme functions specifically to do so inside of the template.php for your theme. I'm not going to get into the specifics of it, as it's covered elsewhere on d.o. Just go looking to learn about theme functions and that should put you well on your way, but it will require you to learn some php.
Eclipse
Comment #2
aschiwi commentedhey eclipse,
thank you for your reply. i hoped it would be easier but i guess i will have to do that.
is there a way to add this into the module? i guess other people might come up with other css styles they need, like background (color or images) or hover styles...
or is there any way to turn off that automatic stylesheet stuff? so that i can use my regular stylesheet for styling those images...
Comment #3
eclipsegc commentedAhhh... no... hehe.
I won't be adding it to the module as people could request new things be added (css wise) until I'm blue in the face. What's there are the basic components that someone who doesn't know their way around css needs to make it look nice. Anything else was always intended to be custom.
Also, the automatic css is automatic for EVERY GALLERY type, so if you were to turn it off (which I'd HIGHLY advise against) you'd have to manually build your own css for each gallery type, and that would NOT be fun. I'm thinking of reworking the css themes (and the gallery themes too maybe) so that they can be individually overwritten per gallery type. No clue when this might become available, but it would still require exactly the sort of work I just outlined here.
Eclipse
Comment #4
aschiwi commentedoh I see... sure would be a nice feature though :-D
I will try to find my way around those funny theme functions.
And thank you for an awesome module with a lot of potential :-)
Comment #5
eclipsegc commentedyou don't have to get "around" them. They're designed to be rewritten in your template.php for your theme.
Comment #6
aschiwi commentedHey I just found an easy and quick way to avoid having to learn theme functions (I know I should and I will one day :-)
I took the same class that is used in gallery.css and put it in my style.css (this would be div.something_image_field_thumbnail) and added my padding there. The border and margin properties still come from gallery.css. Works fine for me. Is this an acceptable way to do this?
Comment #7
eclipsegc commentedcss is designed to cascade, so it's probably a fine way of doing it (your theme style.css SHOULD be the last one appended). I just don't suggest going that route since you'll need to manually adjust it for each node type/field you choose to use it on. Learning the theme functions would be much more advisable. Additionally, if you learn drupal inside and out, you could potentially alter my module to include padding settings from a module of your own.
Comment #8
aschiwi commentedokay, thats a good point. learning theme functions is on my to-do list now :-)
thank you for the quickest module support i've experienced so far!
Comment #9
eclipsegc commentedhappy to assist.