Jon*_*nny 5 xslt sharepoint cqwp
我正在构建自定义内容查询Web部件以显示员工内容类型的汇总信息.此内容类型具有名为EmpPhoto的发布图像站点列.我的CQWP运行良好,我需要的所有站点列都可用.
我现在正在创建一个自定义的xsl模板来正确呈现信息但是使用EmpPhoto图像卡住了.
如果我使用代码:
<xsl:value-of select="@EmpPhoto" disable-output-escaping="yes" />
Run Code Online (Sandbox Code Playgroud)
...我得到了一个很好的正确渲染图像.但是我想为这个图像构建一个onmouseover事件,这种方法不起作用.
我想创建一个xsl变量来获取实际的图像URL然后构建我自己的html img并将onmouseover写入例如
<xsl:variable name="EmpPhotoUrl">
<xsl:call-template name="OuterTemplate.GetSafeStaticUrl">
<xsl:with-param name="UrlColumnName" select="@EmpPhoto"/>
</xsl:call-template>
</xsl:variable>
Run Code Online (Sandbox Code Playgroud)
...
<img src="{$EmpPhotoUrl}" onmouseover="" alt="test" />
Run Code Online (Sandbox Code Playgroud)
但是,这不会从EmpPhoto站点列获取URL.我是xsl的新手,所以我可能会错过一个明显的解决方案!
任何帮助非常感谢,
强尼
这是作弊......并且它对 src 属性做出假设。但它就在这里!
<xsl:variable name="EmpPhotoUrl" select="substring-before(substring-after(@EmpPhoto, 'src="'), '"')" />
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6440 次 |
| 最近记录: |