0

I have created a node in drupal with cck fields on it and I created a views to display the contents. Now what I wanted is on a specific area of my page I wanted to get the views result and display it the way I wanted it to be. I know that this can be achieve using region/blocks but what I wanted is to change the layout or display the values in different order/element.

Your reply is greatly appreciated.

Thanks,

mr.b
  • 2,708
  • 8
  • 39
  • 64

2 Answers2

1

You will probably want to just override your views theme output and change there the layout of your views results. You can override about any output, fields layout, nodes layout, page layout. For a quick look at what kind of theme templates you must copy/edit into your theme, check the "Theme information" section on you views display. It's on the base settings of your views.

Mescalito
  • 1,968
  • 1
  • 11
  • 10
  • Thank your for your reply. I think that's what I'm looking for. Can give me a link on how I can override my views? And I can't seem to find "Theme Information" – mr.b Dec 29 '10 at 12:17
  • For more info + links see http://stackoverflow.com/questions/77694/how-to-quickly-theme-a-view plus if you're going to be doing a lot of this work I recommend getting a hold of this book: http://frontenddrupal.com/ – Dan U. Dec 29 '10 at 18:56
0

The theme information is a link in the View module admin. You should see the text Theme Information as a link when creating your views. You will see the first template file for each piece of the view (row, style, then it will list each of your fields). You can override these templates by copying the name of the template files that aren't in bold (those following in the list) and creating a file with that name in your template's directory. I typically make a folder called "views" in the templates folder but I don't believe that is required. You can access your fields with different names depending on where they came from. Use get_defined_vars() to get the names of your variables.

Collin White
  • 640
  • 1
  • 11
  • 27