(P.S. I just have to accept the fact that no-one is ever ever ever ever ever ever ever ever going to answer my question at http://drupal.org/node/310397 so I am posting it again now in this post, worded differently. Perhaps my original question sounded too complicated in my other post? :)
All I would like to know is what I need to do, so that the first item in a views list is more prominent (displayed slightly differently) than all the items underneath. I know it must be very simple as I see it done on a bunch of websites but I just don't know how to do it.
Take a look at the following examples:
http://www.thecitizen.com/~citizen0/taxonomy/term/4
(Here the first 3 items in the list, or the ones that are stickied, have a larger headline & a byline, etc.)
http://www.themesnap.com/theme-demos/publisher-theme/node
(feature blocks #2 and #3 display an image thumbnail teaser and several titles of similar stories underneath. Thus the first item in the list/block differs from the items underneath.)
Could someone point me in the general direction at least? I understand how to work w Views/CCK, etc. So is this done primarily in Views?
Thanks a lot in advance for your help:)
Christine
Comments
I have been asking myself
I have been asking myself the same question a couple of times, but I never really had to do it. I think the best option would be to override the theme function for your view and add a class to the first item. There may be more solutions though - I'd like to read them!
In Views 2, this is easy.
In Views 2, this is easy. Each View has a .tpl.php template file, and you can make a copy in your theme directory and edit it to your heart's content!
e.g. views-view-list.tpl.php
Hope that helps!
__________________________________________________________
Mark Theunissen
Code Baboon
Drupal based services
WONDERFUL!!
Thank you SO MUCH:))
Then I suppose I could add some stuff in there to accommodate for items that are "stickies".
Such as
Since I am a newbie with writing php (but am a pro at moving someone else's code around until things work;) I am sure I can just use another tpl.php file as a cheat sheet to get the code I need. But this definitely points me in the right direction, so THANK YOU very much:)))
Christine
Hey no problem ;) Just check
Hey no problem ;)
Just check out the various templates in that folder (in the Views 2 'theme' folder or whatever it's called). Each one should hopefully be commented with details of the variables that are available to use. Just check... you should have access to each $node, and therefore to $node->sticky (or something like that).
Good luck!
__________________________________________________________
Mark Theunissen
Code Baboon
Drupal based services
hi I don't understand how to
hi
I don't understand how to use this code, Is there anybody can point me the way
http://views.doc.logrus.com/g
http://views.doc.logrus.com/group__views__templates.html
__________________________________________________________
Mark Theunissen
Code Baboon
Drupal based services
Great tut. Thanks
Great tut. Thanks
theming views
See this mustardseed media video about theming views - very useful.,
http://www.mustardseedmedia.com/podcast/episode23