I'm thrilled to have found the Views module. It solves a few headaches I've been having trying to learn all of drupal in one go.
I'm messing with some content and I want a very limited view in a block (I only want title and body) only View type "List View" and "tables" lets you limit fields so I'm going with List View as I don't want tables. The thing it adds content as Unordered lists, thus creating indents and bullets where I don't want them.
I'm pretty new to all this, but I can't find anywhere in the module which adds in the tags ul and li. I hope I can find what ever is doing it and either turn it off, or rip it out.
i.e
instead of
========
- New Thing
- Another New Thing
The body of the thing
Body of that thing
I really want
==========
New Thing
The body of the thing
Another New Thing
Body of that thing
Can somebody point me to the code which is adding the tags, and any suggestions about dealing with it.
Thanks muchly
Comments
your stylesheet
You should be able to look at the source code and use your stylesheet (located in themes/themefolder) to control how it's displayed.
Adding something like
ul {
list-style-type: none;
}
except you'll need a class or id to make it specific.
Ah, but which ID?
I get what you are saying, stop it at the style sheet. I still don't understand where it was being added in the first place though.
Also, what gets generated by the views module ends up looking like this
Which class or id is the one I want? None of them seem to react to
thanks
Try this?
I didn't have time to look at these in drupal. I just made a little static page to test. ul alone won't work in drupal because it has more specific directives already. These might be specfic enough, though.
.item-list ul {
list-style-type: none
}
It might also shut off more bullets than you want, in which case you can try a more specific context:
.view-content .item-list ul {
list-style-type: none
}
etc.
Answer my own question
I love it when you learn enough to answer your own question. :-)
I'll post it just in case other people want to know
I found I had to affect style for "ul li" not just "ul" for class .item-list.
There is an entry in drupal.css which I started playing with. (but I run mutlisite, so I want site/theme specific)
Once I found that worked, I could then make it specific to view-content item-list an not across the board.
So this went into my theme stylesheet.
Congrats!
It's great that you post your solution, too. I like knowing that someone I've tried to help has solved their problem, plus your solution from withint drupal is helpful to others. Nice work figuring it out!
Perfect but... doesn't work for me!
I recognize your solution is correct under all points of view. But why (the Hell) doesn't it work for me?
My view is identical to yours in the generated html, as I have similar goals: I need a list with titles alone.
In the theme's style.css I defined a class which is as specific as possible:
.view-content .view-content-Principale .item-list ul li
('Principale' is the name of the view).
I also put the property "list-style-type: none;" in the all the possibly relevant styles of drupal.css:
ul.menu, ul.menu li, li.expanded, li.collapsed, li.leaf, li a.active
Why does IE and Firefox, all recent versions and updated, keep visualizing circles beside the titles?
Thanks!
THANK YOU!!!
Man, did I get a headache with this one. And nothing worked. Who'd have guessed that you had to include the
<li>in the css. Great work!! Thanks for posting.-- If no-one asked Drupal questions there would be no Drupal answers --
Another Solution
Hi Folks
See: http://drupal.org/node/1892
Works like a charm , you can remove item-list ul li
My function now is:
Hope be useful.
macm
Mario
Another way
Check out this node for a way to easily remove the list item (ul and li) markup from your views lists:
http://drupal.org/node/136136
Charles
www.parkroad.co.za
Charles
Drupal development, Cape Town, South Africa
THANK YOU
Mr. foxtrotcharlie, you totally rock.
If you want to know why you made my day, here's my tale:
http://drupal.org/node/212078
Thank you.
Garland needs a different way
If you are using Garland, the list-style is already none! It uses a background image!
will do the trick!