Sharepoint 2010 Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint 2010       RSS Feeds

Custom View Styles in 2010?

  Asked By: Tapasvi    Date: Nov 29    Category: Sharepoint 2010    Views: 6297

I added a Custom SharePoint List to a page on our Sharepoint 2010 site. I opened
the page in edit mode by clicking on Site Actions -> Edit Page, then opened the
properties of the list by clicking the arrow next to the web part title and
clicking "Edit Web Part" from that context menu. From there, I clicked the "Edit
the current view" link underneath the "Selected View" dropdownlist.

On the "Edit View" page, I noticed that one of the options that can be set is
View Style (e.g.: Basic Table, Boxed, no labels, Boxed, Newsletter, etcetera). I
was hoping to be able to extend this list with my own custom style.

Specifically, in my list I have an attachment column, a title (a "Single line of
Text" type), and a type (a "Choice" type). I would like to create a style which
could be re-used across our entire portal that would allow users to create
different "Types" and have them display in my custom CSS, so that instead of:

I would display something like:
<tr class="headerStyle">
<td colspan=2>Type</td>

The above HTML is somewhat of an oversimplification, but perhaps you get the
idea - in this case I would like to be able to choose "Headline Style" from the
list of View Styles and have other lists formatted like the above.

Any ideas?



4 Answers Found

Answer #1    Answered By: Aastha Acharya     Answered On: Nov 29

To do that you need to edit the vwstyles.xml file. The file is stored in
template/global/xml. Be aware however that this isn't for the faint of
heart. The file is full of XSL and embedded CDATA tags and editing it is
quite a chore.

Answer #2    Answered By: Glenda Roth     Answered On: Nov 29

This is exactly what I was looking for.

Is it "Microsoft supported" to modify this file? I'd assume this file could
potentially be updated in a future patch/service pack?

Answer #3    Answered By: Jada Clemons     Answered On: Nov 29

Yes the file could be overwritten in the future so make sure you keep a good
backup of the file. But it's the only way to add additional styles to the
dropdown in the create view page. As I said, its not something I would
normally recommend because the xml and html involved is very complex. But
it is the only way.

Answer #4    Answered By: Brooke Lewis     Answered On: Nov 29

I figured as much. Glad I could confirm it! Looks like there's some midnight oil
to be burned in my future.

Didn't find what you were looking for? Find more on Custom View Styles in 2010? Or get search suggestion and latest updates.