I realized that with views you can have a "Page View" and a "block view" all from the same views "object" and each one can have its own "view type" which is also very convenient but NOT always very practical since, >> they both share the same fields <<
wouldn't be possible to have each one its own fields ?

let me explain with an example

Imagine the setup:

the "block view" has a "list view" of only one field (lets say "title" with link to the node)
with a more link at the bottom that takes us to

the "page view" which is setup as a "table view" with more details and more than one field
("title","author","#comments","last comment" etc)

can it be done currently ? (sorry if it can I did not realize)

I could picture each field in the views setup screen to have a checkbox that read "display with page view" and "display with block view"

Hope I was clear enough !!

Comments

merlinofchaos’s picture

Title: views: feature ruquest » Support different sets of fields for each view type
Status: Active » Postponed

First, the titles need to be more distinct.

Second, this is a very large feature request, and I have plans for something that will take care of this in Views 2. I'm not going to do this the way you suggest, the implementation would be much harder than it sounds like.

giorgosk’s picture

OK I understand,

thanks for the consideration

andremolnar’s picture

Just posting here to provide a temp solution for those looking for one:
I was looking for this exact functionality myself (i.e. different fields for a block) - this can be achieved by using the argument handling code section:

You can do something like:

if ($type == 'block') {
  $view->field = array(
            array
                (
                    'vid' => '3',
                    'tablename' => 'node',
                    'field' => 'title',
                    'label' => 'Event Name',
                    'handler' => 'views_handler_field_nodelink',
                    'sortable' => '0',
                    'defaultsort' => '0',
                    'options' => 'link',
                    'position' => '0',
                    'fullname' => 'node.title',
                    'id' => 'node.title',
                    'queryname' => 'node_title',
                ),
              );
}

The example would simply return a single field (node title) in a block view. Otherwise the view is unaltered and shows whatever fields were defined via the GUI.

Note that 'fullname' and 'queryname' are absolutely required or you will get errors...

andre

aren cambre’s picture

Will this work even if no arguments are specified?

merlinofchaos’s picture

Yes

aren cambre’s picture

Status: Postponed » Fixed

This was fixed. You can override fields on each display.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.