Styling / theming CCK output

modul - March 12, 2007 - 08:00

Hi all,

I have a content type called "magarticle". There are two CCK fields which belong to magarticle, namely "authorname" and "yearpublished".

When I display these fields, they are organized vertically, like this:
authorname: Hemingway
yearpublished: 1954

What I would like to do, is to output them on the same line, with a separator, so like this:
authorname: Hemingway --- yearpublished: 1954

I tried inserting some code in field.tpl.php, but the problem is that this script is iterated twice, and each time the output apparently begins a new line.

How can I avoid this, and keep my output on 1 line?

Thanks,

Ludo

Forgot to mention: I'm using

modul - March 12, 2007 - 08:00

Forgot to mention: I'm using Drupal 5.1.

Ludo

try playing around with css

stoeckler - March 12, 2007 - 09:14

try playing around with css a little, display: inline and the different float types should do the trick. for the "---" i would go with a background image, also defined by css.

assuming you use views to display the fields, you could also change the views type to "teaser list" and beautify your teaser outpout in a correlating node-type.tpl.php.

Content Templates (Contemplate)

edex13 - March 12, 2007 - 11:26
 
 

Drupal is a registered trademark of Dries Buytaert.