列出发布者和过滤 [英] List Publisher and Filtering
问题描述
是否有一种方法可以为列表提供公共站点过滤选项?例如,允许网站访问者按国家/地区筛选结果。理想情况下,我想设置一个2区布局(并排),结果在第一区和第二区的过滤条件表。
< blockquote>所以我一直在研究这个问题,并认为可以通过List Publisher自定义布局XSLT过滤数据。它不理想,因为我认为过滤器不适用于服务器端,但我的数据集足够小(<200条记录),我可能可以通过输出例程中的跳过记录来逃避。我的问题是我不太了解XSLT。我怀疑我需要修改的部分XSLT是...
....
<! - 渲染内容 - >
< xsl:for-each select = QUOT; //数据/列"> ....................................我相信我可以在这里应用某种过滤器< ; tr valign =" top">
< xsl:if test ="(position()mod 2)= 0">
< xsl:attribute name =" class"> BG_Light< / xsl:attribute>
< / xsl:if>
< xsl:for-each select =" @ *"> ...............我认为这是通过数据行中的每个字段
所以我想说我有一个字段名称(不是显示名称)调用[state]并且假设我想过滤[state ='CA']的位置。我想我可以修改
< xsl:for-each select =" // Data / Row">
to to< xsl:for-each select =" / / Data / Row [state ='CA']">
最后我想将硬编码的'CA'值更改为URL参数(例如somesitename.com/page.aspx?state=CA )
不幸的是,我已经尝试过基本的硬编码XSLT而且它没有'工作。有什么想法吗?搜索结果
Is there an approach one can take to provide public site filtering options for a list? For example, allow site visitor to filter results by country. Ideally, I would like to setup a 2 zone layout (side-by-side), results in 1st zone and filter criteria form in 2nd zone.
So I have been looking into this further and think it may be possible to filter data via the List Publisher Custom Layout XSLT. Its not ideal, as I would imagine the filter is not applied server side but my dataset is small enough (<200 records) that I probably can get away with skipping records in the output routine. My problem is that I don't understand XSLT all that much. I suspect part of the XSLT I would need to modify is...
....
<!-- Render contents -->
<xsl:for-each select="//Data/Row"> ....................................I believe I can apply some sort of filter here
<tr valign="top">
<xsl:if test="(position()mod 2) = 0">
<xsl:attribute name="class">BG_Light</xsl:attribute>
</xsl:if><xsl:for-each select="@*"> ...............I assume this is going through each field in the data row
....
So lets say I have a field name (not display name) called [state] and lets say I want to filter where [state='CA']. I would think I could modify
<xsl:for-each select="//Data/Row">
to
<xsl:for-each select="//Data/Row[state='CA']">
Eventually I want to change the hardcoded 'CA' value to URL Parameter (ex. somesitename.com/page.aspx?state=CA)
Unfortunately, I have tried the basic hardcoded XSLT and it doesn't work. Any thoughts?
这篇关于列出发布者和过滤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!