Hi there,
I'm using the more options page to offer visitors some terms from two vocabularies. I'm currently trying to style the page with just CSS and it has proven to be an absoloute nightmare because of the tables on the page. One vocabulary only has four terms and for some reason they're displayed in two columns instead of one. I've tried using floats to display the td's under eachother, but after every td some mysterious space showed up even though I've set the margin and padding to 0 for every element in the table (talk about lengthy css :-P). And this is just in firefox, IE7 has some other issues, while IE8 shows it almost the same as firefox.
Now, I won't start some furious semantics-rant on why tables shouldn't be used for layouts. :-)
Is it possible however, to change the theme to not use a table, or even to use a table which does not split the terms into columns?
Thanks in advance!
Comments
Comment #1
weseze commentedsubscribing
I was thinking of hiding this premade guided search block and showing the real guided search block instead. It can be styled much easier! But for some reason this block doesn't show on the search home page...
Comment #2
weseze commentedAfter some searching and coding I came up with little module that can override most of the generated html with custom code. It doesn't do much but should make it easier to style most of it... And you can build on it to make a better module!
It basically overrides the theme function that makes the nasty tables. I've included some documentation of what's coming in to the function.
Put the files in 'sites/all/modules/extended_faceted_search' and enable the module.
extended_faceted_search.info
extended_faceted_search.module
Comment #3
libeco commentedThanks, that's a huge improvement! There's still a table around the categories though. And I also think that a listing of terms semantically belongs in an ul element so I slightly altered your code:
$html = '<div class="faceted-search-guided-search-taxonomy-block">';... became ...
$html = '<ul class="faceted-search-guided-search-taxonomy-block">';... and ofcourse the
</div>changed to</ul>.And I also changed
$html .= $html_for_term";... to ...
$html .= "<li>" . $html_for_term . "</li>";*edit*
Actually, I just placed this function in my template.php, I don't think I need a module for this change.
Comment #4
weseze commentedit isn't necesary to put it in a module, you can just put it in template.php.
I made a module of it because I run a multisite Drupal and want to make this hack available to all the sites without having to rewrite en reupload all of my template.php files...
Comment #5
libeco commentedI see. Well thanks for it anyway, it's a huge improvement!
Comment #6
cyberwolf commentedSubscribing.
Comment #7
nicolasM commented#3 works for me.
Thanks libeco !
Comment #8
ha5bro commentedAwesome, thanks wesley_2mpact!