我有一个简单的DataFormWebPart,我正在使用XSLT来呈现列表的内容。我想将每个列表项的@Author字段与当前用户进行比较,但以下内容不会评估为true:
在XSL的标题中:
<xsl:param name="UserID" />
并在评估行的模板中:
<xsl:value-of select="@Author" />
<xsl:if test="@AuthorID = $UserID">(you)</xsl:if>
我有@Author和$ UserID的值:
我可以使用什么表达式来获取用户配置文件的非超链接值?
答案 0 :(得分:1)
快速获胜:
<xsl:value-of select="contains(@Author,concat('>',$UserID,'<'))" />
答案 1 :(得分:1)
应该参考
https://sharepoint.stackexchange.com/questions/21202/custom-form-does-not-display-created-by-value
<tr>
<td valign="top" class="ms-formlabel"><nobr>Created by</nobr></td>
<td valign="top" class="ms-formbody">
<SharePoint:CreatedModifiedInfo ControlMode="Display" runat="server">
<CustomTemplate>
<SharePoint:FormField FieldName="Author" runat="server" ControlMode="Display" DisableInputFieldLabel="true" /><br/>
<SharePoint:FieldValue FieldName="Modified" runat="server" ControlMode="Display" DisableInputFieldLabel="true"/>
</CustomTemplate>
</SharePoint:CreatedModifiedInfo>
</td>