Howdy,
Is there any way to remove the DIVs that surround lists in Drupal 6? I see many of them in views-view-list.tpl.php, and I don't want to edit that file because it'll just get overwritten when I upgrade.
Thanks!
Adam
Howdy,
Is there any way to remove the DIVs that surround lists in Drupal 6? I see many of them in views-view-list.tpl.php, and I don't want to edit that file because it'll just get overwritten when I upgrade.
Thanks!
Adam
Comments
Comment #1
primalmedia commentedThese are the ones I'm looking to remove, any input would be appreciated.:
Comment #2
merlinofchaos commentedYou're using Drupal. I recommend you read the documentation on theming. Also, this is not a bug.
Comment #3
primalmedia commentedThanks Merlin of Chaos! I understand this is by design. What I'm looking for is some information on how to theme away the unnecessary DIV's that Views needlessly adds to lists. Personally, I think it's a bug. I'd like to keep this support request active in case someone has better ideas on how to fix this Bug.
Other people are also looking for smart, clean code without the superfluous DIV's and classes: http://drupal.org/node/266737, and other people are bouncing ideas around for best ways to remove the DIV's from list views: http://drupal.org/node/157380. So why is this by design? And has anyone figured out a way to repair this bug in Drupal 6?
Comment #4
merlinofchaos commentedSo you didn't actually read the documentation? There is documentation on how to theme Views, and if you are not interested in reading it, then why would anyone be interested in helping you? If the documentation is unclear, perhaps asking specific questions would get better results.
Comment #5
LiquidWeb commentedFirst of all this is not a bug but feature (I like using this sentence :) ) and please click "Theme information" link on View configuration page that will make everything clear.
Comment #6
catchhttp://letmegooglethatforyou.com/?q=site%3Adrupal.org+views+documentation
Comment #7
primalmedia commentedThank you rakisisesindekibalik for telling me about the Theme Information. It was useful to find out about rescanning the template files.
I still do not understand why all the DIV classes and LI classes need to be there. Does anyone have a good explanation for this? I've read something where Merlin says he can justify them all, but I wasn't able to find his reasons. Why not just clean code?
To get rid of the LI classes and the
Thanks again for your help.
Adam
Comment #8
merlinofchaos commentedSearch closed issues. I've explained this a few times, and I'm tired of explaining it.
The divs and classes are there because they are necessary to do some things. Just because they aren't things you want to do is irrelevant. You are not going to get a detailed breakdown of every class and every div, my time is more valuable than that.
Please stop complaining about this issue. This is not changing. If you don't like it, you've got two choices: Theme it, or go use another piece of software. EOF.
Comment #9
Paul Lomax commentedWhat we do:
- Create a theme in your sites/all/themes folder, call it 'reset' or similar.
- Add views-view.tpl.php & views-view-unformatted.tpl.php to it. (Plus any others you are likely to use, copy them from the views module folder)
- Remove all div's from said files.
- You can also add any CSS resets you use a lot in here, or common theme functions. Things that Drupal does by default that you are never likely to use.
Include this theme in your main site theme by putting:
base theme = "reset"
In your .info file.
Job done, you will never see those div's again.
The big problem is there is a large divide in Drupal between people who build sites using entirely contributed themes, i.e. They never touch any code, and more advanced 'themers'.
The div's are there for the former, some stuff you can do with views will break without them and if you don't know how HTML works it would be impossible to figure out.