如何在Sharepoint List中自定义Dispform.aspx

时间:2021-01-26 10:48:47

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.

我有一个SharePoint网站,我一直试图修复一段时间。我没有在NewForm.aspx和EditForm.aspx中添加字段的问题,但Dispform.aspx似乎是一个完全不同的问题。

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

我一直在使用SharePoint Designer,看起来好像所有其他字段都使用这个显示:

<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?

简介:如何添加要在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 个解决方案

#1


Your approach is okey, couple of things to check:

你的方法很好,有几件事需要检查:

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

1)每个数据视图Web部件都有DataFields标记,如下所示:

<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:

2)内部字段名称和字段名称之间也存在差异。在上面的示例中,注释是内部名称,但名称是Notes。因此,要正确显示Notes字段,您应该使用:

<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.

3)确保您尝试在XSLT模板的正确位置输出此值。找到这个地方的最简单方法是查找现有字段,然后沿着这些字段添加新字段。

Hope it helps...

希望能帮助到你...

#1


Your approach is okey, couple of things to check:

你的方法很好,有几件事需要检查:

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

1)每个数据视图Web部件都有DataFields标记,如下所示:

<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:

2)内部字段名称和字段名称之间也存在差异。在上面的示例中,注释是内部名称,但名称是Notes。因此,要正确显示Notes字段,您应该使用:

<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.

3)确保您尝试在XSLT模板的正确位置输出此值。找到这个地方的最简单方法是查找现有字段,然后沿着这些字段添加新字段。

Hope it helps...

希望能帮助到你...