I have a view with an unordered list that I'm using in a sidebar. How would I change the color of a Selected list item with css?
Hi Brent,
What is the item you name a selected? Like the active page, i.e. when you are viewing an entry which is a part of the View?
I don't think we have this in Views yet.
Mario
This is what I have in a view,
[wpv-layout-start]
<!-- wpv-loop-start -->
<wpv-loop>
- [wpv-post-link]
</wpv-loop>
<!-- wpv-loop-end -->
[wpv-no-posts-found][wpml-string context="wpv-views"]No posts found[/wpml-string][/wpv-no-posts-found]
[wpv-layout-end]
So I need the current selected title within this list to change color. If that makes since. I'm using the view widget to pull in the view within the sidebar.
Hi Brent,
This is not possible with CSS, you have to use some JavaScript to trigger this behavior. We don't set automatically classes for active menus. You need to wrap the loop in a div with some ID and then use a JS snippet in your theme similar to this one: http://stackoverflow.com/questions/2521028/jquery-menu-active-link
Best,
Mario
Ah yes, I'll try it out, thanks for the help on this. I thought maybe it would work like wordpress does with the default .current-item class for menus. Thanks
It has some extra logic out there for the menus being a very large menu-oriented module so that's the reason they have extra classes for that.
Best,
Mario