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.

AttachmentSize
node_displaw_DIV_wrapper.patch1.91 KB

#1

NancyDru - March 9, 2009 - 19:52
Status:reviewed & tested by the community» needs review

You cannot set your own issue to RTBC - that requires at least one other reviewer/tester.

I will check it out.

#2

NancyDru - March 9, 2009 - 20:01

How does this work better than

#block-taxonomy_image-0 img {
  something...
}

#3

thePanz - March 9, 2009 - 20:53

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

NancyDru - March 10, 2009 - 00:25

"#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

thePanz - March 10, 2009 - 12:32

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

NancyDru - March 14, 2009 - 14:58

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

thePanz - March 15, 2009 - 13:11

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

NancyDru - March 15, 2009 - 17:45

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_links to taxonomy-image-links.

#9

thePanz - March 15, 2009 - 23:35

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

NancyDru - March 16, 2009 - 00:12
Status:needs review» fixed

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

thePanz - March 16, 2009 - 00:22

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

thePanz - March 16, 2009 - 00:38
Status:fixed» needs review

Added themable function for TI images.
This can be used to theme images inside a list, etc

AttachmentSize
node_display-add_themable_div_wrapper.patch 2.24 KB

#13

NancyDru - March 17, 2009 - 14:47
Status:needs review» fixed

Committed.

#14

thePanz - March 17, 2009 - 14:52

Hi, thank you for committing my patches. Hope my posts didn't stress you too much! :)

Regards.

#15

NancyDru - March 17, 2009 - 16:10

Doing patches is a lot less stressful (other than typing really long Windows path names). Thanks.

#16

System Message - March 31, 2009 - 16:20
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.