新云4.0中如何在标题列表中显示更多的字段内容,例如username

新云4 中加入了新东西,xlst,目前论坛对这个的研究不多。

 

经过几个小时的研究,先是在论坛中4.0板块中从第一页翻到第十页,发现有两个人问到了这个问题,不过版主没给出解决方法。

 

直接在论坛中搜索xlst,没有帖子。

 

没办法只好自己研究代码了,虽然从来没搞过asp,xlst也是用新云后才开始看的。

 

但是有PHP的基础,代码看起来不算特别困难。

 

通过对代码的反向查找,终于找到了inc/template.inc这个文件,其中:

===================================================

  channid  = NewAsp.ChkNumeric(iXMLDom.documentElement.getAttribute("channelid"))
  classid  = CheckIDlist(iXMLDom.documentElement.getAttribute("classid"))
  specialid = NewAsp.ChkNumeric(iXMLDom.documentElement.getAttribute("specialid"))
  maxnum  = NewAsp.ChkNumeric(iXMLDom.documentElement.getAttribute("maxnum"))
  stype  = NewAsp.ChkNumeric(iXMLDom.documentElement.getAttribute("type"))
  setcache = NewAsp.CheckStr(iXMLDom.documentElement.getAttribute("setcache"))
  rootNode = NewAsp.CheckStr(iXMLDom.documentElement.getAttribute("node"))
  imgWidth = NewAsp.ChkNumeric(iXMLDom.documentElement.getAttribute("width"))
  imgHeight = NewAsp.ChkNumeric(iXMLDom.documentElement.getAttribute("height"))
  strLength = NewAsp.ChkNumeric(iXMLDom.documentElement.getAttribute("length"))
  datemode = NewAsp.CheckStr(iXMLDom.documentElement.getAttribute("datemode"))
  showcate = NewAsp.ChkNumeric(iXMLDom.documentElement.getAttribute("showcate"))
  showdate = NewAsp.ChkNumeric(iXMLDom.documentElement.getAttribute("showdate"))
  showimg  = NewAsp.ChkNumeric(iXMLDom.documentElement.getAttribute("image"))
  strTarget = NewAsp.CheckStr(iXMLDom.documentElement.getAttribute("target"))
  NoTitle  = NewAsp.ChkNumeric(iXMLDom.documentElement.getAttribute("notitle"))
  Eachline = NewAsp.ChkNumeric(iXMLDom.documentElement.getAttribute("eachline"))
  strlen  = NewAsp.ChkNumeric(iXMLDom.documentElement.getAttribute("strlen"))
  strSQL  = iXMLDom.documentElement.getAttribute("sql")&""
  strField = iXMLDom.documentElement.getAttribute("field")&""

==============================================================

 

注意最后一个参数:strField = iXMLDom.documentElement.getAttribute("field")&""

 

看到Field字样,大概知道有戏了。

 

于是:{$xml:newslist file="newslist.xslt" field="username," setcache="0" type="0" showuser="1" channelid="{$channelid}" classid="0" maxnum="20" length="56" showcate="1" showdate="1" datemode="MM-dd"}

 

添加filed字段: field="username,"  (注意这里要加一个英文逗号)

 

因为下面sql的组合是这样的:SQL=" A.ArticleID,A.ClassID,A.ColorMode,A.FontMode,A.title,A.BriefTopic,A.subtitle,A.OuterLinks,"&strField&"A.Author,A.AllHits,A.WriteTime,A.HtmlFileDate,A.isBest,A.ImageUrl,A.star,A.IsTop,"

 

在xlst文件中如果需要引用的话就用这个:<xsl:value-of select="@username"/>

 

最终效果图:

 

http://bbs.yuyinweb.com/viewthread.php?tid=547&extra=

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值