views:

1908

answers:

1

Good Morning,

I have a SharePoint site that I've been trying to fix up for awhile. I haven't had problems adding fields into the NewForm.aspx and EditForm.aspx, but Dispform.aspx seems like a whole different problem.

I've been using SharePoint Designer, and it looks as if all the other fields are displayed using this:

<xsl:value-of select="@Priority"/>

But when I go ahead and follow the same format to try to insert a new field, it continues to pull up empty values when I'm positive something should be there.

SHORT: How can I add fields to display on DispForm.aspx?

Any help would be GREATLY appreciated, I'm so stuck!

Thanks, E

SOLUTION:

I had forgotten to add my new columns under the Content Type of the List I was using. Thanks for the help!

+1  A: 

Your approach is okey, couple of things to check:

1) Each Data View Web Part has the DataFields tag, it looks like this:

<DataFields>@URL,URL;@Comments,Notes;@Color,Color;@Image,Image;</DataFields>

and it contains the names of your fields. Make sure your new field is displayed in this list.

2) Also there is difference between internal field name and field name. In the example above Comments is internal name but name is Notes. So to display Notes field correctly you should use:

<xsl:value-of select="@Comments"/>

3) Make sure you are trying to output this value in the right place of XSLT template. The easiest way to find the place is to look for existing fields and just add the new one along these.

Hope it helps...

Toni Frankola
These are the first things I guessed, too. Unfortunately, it seems that all my new fields were automatically inserted into the <datafields> tag, and I've checked and double-checked the fields names.Thanks for the help, but I'm afraid I'll still be wrestling with it! haha.
Did this solve the problem? If it didn't, it's a bit confusing that it's marked as the answer.
Andy Mikula
@Andy: Me too... but I do not mind additional points. @Ethan: Can you start from scratch and delete your web part... you are doing everything as you should but you are probably missing something simple.
Toni Frankola