Answered How to change the left column's attribute in a preview pane list view?

  • Sunday, August 31, 2008 11:35 AM
     
     
    Hello,

    I have been surfing the net fo  an answer on this one for days now and I can't seem to find the right answer.

    We have created a view on a list based on the Preview Pane Style.
    The list "business contacts" has a few columns: name, location, company, contact.
    After creating a view based on the Preview Pane style, automatically a list control is created on the left based on the name field. However I would like to configure it in a way that the contact column is used to fill the left list control.  What is the best way to do this?

    Roger

Answers

  • Tuesday, September 02, 2008 2:32 PM
     
     Answered Has Code
     Yes, I got it to work.

    What I did was looking up the field "name(link to item)" and "name(link to item with menu" and change both displaynames to "contact". (of the list item)
    Then I changed the following thing in the field "contact(link to item)" :

    from <FieldRef Name="name" /> to <FieldRef Name="contact" />

    and <Column HTMLEncode="TRUE" Name="name" Default="(no title)" /> to <Column HTMLEncode="TRUE" Name="contact" Default="(no title)" />

    Save everything and it worked for me.
    Even after changing views this kept working.

    Addition: be careful in a production environment using spcamleditor the first time, because it will restart your IIS server
    • Edited by Roger Beulen Tuesday, September 02, 2008 6:29 PM addition
    • Marked As Answer by Roger Beulen Thursday, December 01, 2011 1:55 PM
    •  

All Replies

  • Sunday, August 31, 2008 11:01 PM
     
     
    You have to edit the resultant CAML.  Use a tool like SPCAMLEditor to connect to the view (the view can be found by navigating to the list associated with the view and finding a view with a GUID for a name.  I can't remember exactly where it is in the CAML (I don't have an environment in front of me at the moment) but I want to say that it's in the ViewHeader element - a little bit of experimenting will help you find it pretty easily (I had to do the same thing just a couple of weeks ago and it only took me a couple of minutes to find the right elements to edit).
  • Sunday, August 31, 2008 11:02 PM
     
     
    Almost forgot - if you make this change and then edit the view again via the browser it will reset it so you'll have to do it again - really annoying I know.
  • Tuesday, September 02, 2008 7:48 AM
     
     
    Hi Gary,

    Thank you so far for your help.

    I've tried spcamleditor and indeed I can change the value of the left column from name to contact. However then I am missing something since the linkTitle functionality is still connected to the name field.  So I can't edit the item based on my new value contact. How can I change that too?

    By the way I found the linktitle field (linked to name) in the ViewBody area and not the ViewHeader area.
    • Edited by Roger Beulen Tuesday, September 02, 2008 9:10 AM addition
    •  
  • Tuesday, September 02, 2008 2:32 PM
     
     Answered Has Code
     Yes, I got it to work.

    What I did was looking up the field "name(link to item)" and "name(link to item with menu" and change both displaynames to "contact". (of the list item)
    Then I changed the following thing in the field "contact(link to item)" :

    from <FieldRef Name="name" /> to <FieldRef Name="contact" />

    and <Column HTMLEncode="TRUE" Name="name" Default="(no title)" /> to <Column HTMLEncode="TRUE" Name="contact" Default="(no title)" />

    Save everything and it worked for me.
    Even after changing views this kept working.

    Addition: be careful in a production environment using spcamleditor the first time, because it will restart your IIS server
    • Edited by Roger Beulen Tuesday, September 02, 2008 6:29 PM addition
    • Marked As Answer by Roger Beulen Thursday, December 01, 2011 1:55 PM
    •