0

drupal 6 user here. I am sure that this is basic views question but I can not figure answer to it. I have a simple view with 2 fields - node title (field_title) and node author (field_author). I want to print all data separate so that node titles would be printed inside ONE single separate div and node authors would be printed in another div. This can not be achieved using rewrite option as far as I know. Can anybody help me with this? Thank you.

  • Have you tried unformatted list in views? – harshal Sep 13 '13 at 20:03
  • @harshal every output I tried gives results like fieldA1 fieldB1, fieldA2 fieldB2 and so on. I need fieldA1 fieldA2 in separate div and fieldB1, fieldB2 in separated div. – loparr Sep 13 '13 at 20:47
0
  1. Go to your view: admin/build/views

  2. Edit your view: admin/build/views/edit/view_name

  3. Look at your fields node title (field_title) and node author (field_author) and click on Node:Title for instance

  4. Once editing the view output of the Node:Title field, check "Rewrite the output of this field"

  5. You should see replacement patterns: [title] == Node: Title

In the Rewrite this field section called "Text:" enter

    <div class="some-class-name">[title]</div>
  1. Repeat 3,4 and 5 for the Node:Author field.

    <div class="some-class-name-author">[author]</div>
    
  2. You can put anything else in the rewrite field here.

(note: D7 has more options that using the rewrite method)

  • This is not what I am interested in. I need to output fieldA results inside ONE div. Not many divs with same class. – loparr Sep 13 '13 at 23:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.