By thepaul on
I'm using a table view to create a "recent articles" block on my homepage. I want to include the article title and the article teaser right below it.
[example]
Article Title
Article snippet will be displayed here
Unfortunately when I include both the title and the body/snippet fields they are placed in their own columns so it looks like this:
Artice Title | Article snippet will be displayed here
How can I include the two fields in a single column? Even if they were in the same cell seperated by a
I would be happy.
Comments
Did you try using list view?
Did you try using list view? It will put all the content in one column and each node gets a bullet. you can set table view and list view in the Administer->site building-> views
This requires the "Views" module, so make sure you have that enabled.
Hi thanks for the reply. I
Hi thanks for the reply. I am using the views module, but not using a listview because I want to use zebra striping for "even"/"odd" items in the view. I basically just want to use tableview, but display the fields in rows rather than columns (vertically rather than horizontally).
Still stuck
and hoping that someone with an answer might see this.
Well if no one knows how to
Well if no one knows how to display mutpile fields in a single table column or cell ... can anyone tell me if it is possilbe to do zebra stripes with list view?
I cant say I have ever done
I cant say I have ever done this myself, but a module included in the "Views" module is "Views Theme Wizard" It generates code that is a starting point for more customization over your view. I believe you could use this to put more than one item in a table or to apply stripes to the list view. Check the directions here http://drupal.org/node/42597
As well, something i have done to get strips in my list view was customize my "sites/all/themes/[My theme]/style.css" file "themes/[My theme]/style.css". In the following example I made the event start time, Date modified, and Time until event test areas a dark blue with a lighter text. This gave the appearance of zebra stripes in my list view. You are going to have to know how to get the class of the property you want to stripe. I use the developers toolbar for firefox ( https://addons.mozilla.org/en-US/firefox/addon/60 )and use the "information->display Element Information" tool. here is the code i added to my style.css file to get the zebra striped effect.
I managed to do this by
I managed to do this by puting a function in my template.php file. just replace "announcements_all" in the function name with the name of your table view.
I originally had a 4 column table(Group name, Taxonomy term for announcement type, node type, node title), but I changed it to a 2 column table with 3 data items in the first column and 1 data item in the second column. (Group name+Taxonomy term for announcement type+node type, node title)
you can see what it looks like by going to
http://shigajet.org
and look for the announcements block
zebra stripes just for tables
markDrupal,
Wow thanks for sharing this, your site is looking very nice with the zebra stripes in links list and tables. I have one question, I want to make a function to add a class called alt or odd, to all tables in nodes. I am theming a charity site, and I've tried using the JavaScript from (http://www.alistapart.com/articles/zebratables/) & (http://veerle.duoh.com/blog/comments/a_css_styled_table/#c_2986), placing a link to it manually on my page template. I can see the script is there using FireBug, but it doesn't add the class to my tr's, can anyone help me please.
Nicolas
-------------------------
http://nic.ipwa.net
Nicolas
-------------------------
The a list apart method was
The a list apart method was not working because I didn't add the onclick to the body. I found a better script that worked beautifully: http://validweb.nl/artikelen/javascript/better-zebra-tables/
Nicolas
-------------------------
http://nic.ipwa.net
Nicolas
-------------------------
Thanks you. This worked for
Thanks you. This worked for me. The classes didn't work for me though. I wish it did 'cause I want to theme some of the fields.
I had 5 columns and wanted to combine the last three columns to the second column and leave the first column intact. The result is two columns.
Thought I would share..
After researching this option.
I also found (In Drupal 6x) that you can set your fields to appear in the same column in the view Style:Table settings. Just choose the same column as the primary field is being displayed in. Ex. field "Title" is displayed in Node:Title column, then add field "Image" to display in Node:Title column also.
Still a Noobie here..