Add DIV wrapper for better theming
thePanz - March 9, 2009 - 09:34
| Project: | Taxonomy Image |
| Version: | 6.x-1.x-dev |
| Component: | Contrib Node Display |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
I manage to add a wrapper DIV for node display sub-module.
I'm now able to easily theme this node element.
Patch tested.
| Attachment | Size |
|---|---|
| node_displaw_DIV_wrapper.patch | 1.91 KB |

#1
You cannot set your own issue to RTBC - that requires at least one other reviewer/tester.
I will check it out.
#2
How does this work better than
#block-taxonomy_image-0 img {something...
}
#3
First of all: sorry for my RTBC issue status.
Using "Node Display" I didn't found any "#block-taxonomy_image-0" ID inside rendered HTML in my nodes.
Some disadvantages of IDs:
- Having a unique ID is difficult to select "all" taxonomy-images for theming using CSS
- TI have to create unique ID for each node taxonomy-images (think about a list of nodes inside a View and valid HTML issues)
maybe using #prefix and #suffix form elements isn't the cleanest way to resolve this issue.. but I didn't find any other (better) solution :)
Regards
#4
"#block-taxonomy_image-0" is what is generated for the block itself and applies only to that block. TI already does have an option to generate a wrapper (I don't recall if I have it turned off inside that block) for all images by default. I'm just trying to figure out if there is a way to do what you want that's already in TI.
#5
Using Node-Display no HTML is outputted for images, only a "\n" separated list of IMG tags is printed inside the content.
Maybe a better solution is to provide an overridable theme() function also for "Node Display" sub-module.
Regards
#6
I think maybe you inadvertently have a very old version of that module. The "taxonomy_image_node_display.module" should live within a directory called "taxonomy_image_node_display", which should be under "contributed", which should be under "taxonomy_image." If it is still in the main module directory it is an old version and should be deleted. You may have to disable and re-enable it.
Path within your module folder: taxonomy_image/contributed/taxonomy_image_node_display/taxonomy_image_node_display.module
#7
I'm using latest -dev version.
Maybe you looked at the the patch file that doesn't have any path displayed before module name.
I've created the patch using TortoiseCVS under Windows.
#8
I can do this with the code that's already there:
a.taxonomy_image_links img {border:2px outset black;
margin-right:20px;
}
Your patch will give you nothing over this, AFAICT.
I am committing a change to change
taxonomy_image_linkstotaxonomy-image-links.#9
I found why we don't have the same HTML code!
I'm displaying only images while you've enabled "Link displayed Taxonomy Image to taxonomy/term/n page", (correct me if I'm wrong).
Try to display only images :)
With my "added DIV" I manage to place all images (and images with link) in a the top-left side of my node content (using floats). Using only link class (as you suggested) this couldn't be possible.
Regards
#10
Committed to 6.x only. It is not a setting though. If you do not link to the term page, you will get the wrapper. Thank you for the patch.
Please let me know what you think after you test it; I am just about ready to produce a new release.
#11
Hi, I updated my -dev version with your latest commit.
My 2 cents:
- the DIV would be useful also for linked images (same reason as before, fine theming can be done also on single link class)
- the DIV should be themable/overridable... maybe using the theme() hook
#12
Added themable function for TI images.
This can be used to theme images inside a list, etc
#13
Committed.
#14
Hi, thank you for committing my patches. Hope my posts didn't stress you too much! :)
Regards.
#15
Doing patches is a lot less stressful (other than typing really long Windows path names). Thanks.
#16
Automatically closed -- issue fixed for 2 weeks with no activity.