列出发布者和过滤

编程入门 行业动态 更新时间:2024-10-23 19:21:50
本文介绍了列出发布者和过滤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

是否有一种方法可以为列表提供公共站点过滤选项?例如,允许网站访问者按国家/地区筛选结果。理想情况下,我想设置一个2区布局(并排),结果在第一区和第二区的过滤条件表。

解决方案

所以我一直在研究这个问题,并认为可以通过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/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/page.aspx?state=CA)Unfortunately, I have tried the basic hardcoded XSLT and it doesn't work.  Any thoughts? 

更多推荐

列出发布者和过滤

本文发布于:2023-11-13 14:26:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1584571.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:发布者

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!