您的位置: 首页 >日志>动易系统>详细内容

动易系统

PE取得第N级以上父节点或自身

来源:本站原创 发布时间:2016-10-09 10:47:59 浏览次数: 【字体:

制作子站的时候,往往子站的侧栏是不需要它自己的“一级栏目”显示出来的,当子站有二级菜单时侧栏才显示,这样就有一个问题了,默认的“侧栏-菜单”,它会显示出子站名称下面的“一级栏目”,因此要做一个标签来判断!其实也就简单的修改了一下“父节点或自身.config”标签!分享下吧!

  1. xml version="1.0" encoding="utf-8"?> 
  2. <root> 
  3.   <LabelType>改进类 LabelType> 
  4.   <LabelIntro>父节点或自身 LabelIntro> 
  5.   <LabelDataType>sql_sysquery LabelDataType> 
  6.   <LabelSqlString>SELECT TOP 1 arrChildID, NodeID,Depth, ParentID FROM PE_Nodes WHERE NodeID = @nodeId  order by OrderID LabelSqlString> 
  7.   <LabelTemplate><?xml version="1.0" encoding="utf-8"?></span> </span></li> <li style="list-style: decimal-leading-zero outside; border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); line-height: 14px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span class="cdata" style="margin: 0px; padding: 0px; border: none; color: rgb(255, 20, 147); background-color: inherit;"><xsl:transform version="1.0" xmlns:xsl="" xmlns:pe="labelproc" exclude-result-prefixes="pe"></span> </span></li> <li class="alt" style="list-style: decimal-leading-zero outside; border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); color: inherit; line-height: 14px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span class="cdata" style="margin: 0px; padding: 0px; border: none; color: rgb(255, 20, 147); background-color: inherit;"><xsl:output method="html" /></span> </span></li> <li style="list-style: decimal-leading-zero outside; border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); line-height: 14px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span class="cdata" style="margin: 0px; padding: 0px; border: none; color: rgb(255, 20, 147); background-color: inherit;"><xsl:param name="depth"/></span> </span></li> <li class="alt" style="list-style: decimal-leading-zero outside; border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); color: inherit; line-height: 14px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span class="cdata" style="margin: 0px; padding: 0px; border: none; color: rgb(255, 20, 147); background-color: inherit;"><xsl:variable name="countnum" select="count(/NewDataSet/Table)"/></span> </span></li> <li style="list-style: decimal-leading-zero outside; border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); line-height: 14px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span class="cdata" style="margin: 0px; padding: 0px; border: none; color: rgb(255, 20, 147); background-color: inherit;"><xsl:template match="/NewDataSet/Table"></span> </span></li> <li class="alt" style="list-style: decimal-leading-zero outside; border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); color: inherit; line-height: 14px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"> </span></li> <li style="list-style: decimal-leading-zero outside; border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); line-height: 14px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span class="cdata" style="margin: 0px; padding: 0px; border: none; color: rgb(255, 20, 147); background-color: inherit;">    <xsl:choose></span> </span></li> <li class="alt" style="list-style: decimal-leading-zero outside; border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); color: inherit; line-height: 14px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span class="cdata" style="margin: 0px; padding: 0px; border: none; color: rgb(255, 20, 147); background-color: inherit;">        <xsl:when test=" arrChildID=NodeID and ParentID!=0 and Depth &gt; $depth"></span> </span></li> <li style="list-style: decimal-leading-zero outside; border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); line-height: 14px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span class="cdata" style="margin: 0px; padding: 0px; border: none; color: rgb(255, 20, 147); background-color: inherit;">            <xsl:value-of select="ParentID"/></span> </span></li> <li class="alt" style="list-style: decimal-leading-zero outside; border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); color: inherit; line-height: 14px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span class="cdata" style="margin: 0px; padding: 0px; border: none; color: rgb(255, 20, 147); background-color: inherit;">        </xsl:when></span> </span></li> <li style="list-style: decimal-leading-zero outside; border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); line-height: 14px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span class="cdata" style="margin: 0px; padding: 0px; border: none; color: rgb(255, 20, 147); background-color: inherit;">        <xsl:otherwise></span> </span></li> <li class="alt" style="list-style: decimal-leading-zero outside; border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); color: inherit; line-height: 14px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span class="cdata" style="margin: 0px; padding: 0px; border: none; color: rgb(255, 20, 147); background-color: inherit;">            <xsl:value-of select="NodeID"/></span> </span></li> <li style="list-style: decimal-leading-zero outside; border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); line-height: 14px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span class="cdata" style="margin: 0px; padding: 0px; border: none; color: rgb(255, 20, 147); background-color: inherit;">        </xsl:otherwise></span> </span></li> <li class="alt" style="list-style: decimal-leading-zero outside; border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); color: inherit; line-height: 14px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span class="cdata" style="margin: 0px; padding: 0px; border: none; color: rgb(255, 20, 147); background-color: inherit;">    </xsl:choose></span> </span></li> <li style="list-style: decimal-leading-zero outside; border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); line-height: 14px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"> </span></li> <li class="alt" style="list-style: decimal-leading-zero outside; border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); color: inherit; line-height: 14px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"> </span></li> <li style="list-style: decimal-leading-zero outside; border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); line-height: 14px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span class="cdata" style="margin: 0px; padding: 0px; border: none; color: rgb(255, 20, 147); background-color: inherit;"></xsl:template></span> </span></li> <li class="alt" style="list-style: decimal-leading-zero outside; border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); color: inherit; line-height: 14px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span class="cdata" style="margin: 0px; padding: 0px; border: none; color: rgb(255, 20, 147); background-color: inherit;"></xsl:transform> LabelTemplate> 
  8.   <attributes> 
  9.     <name>nodeId name> 
  10.     <default>0 default> 
  11.     <intro> 
  12.      intro> 
  13.    attributes> 
  14.   <attributes> 
  15.     <name>depth name> 
  16.     <datatype>string datatype> 
  17.     <default>0 default> 
  18.     <intro>节点深度 intro> 
  19.    attributes> 
  20.   <CacheTime>0 CacheTime> 
  21.   <OutType> 
  22.    OutType> 
  23. root> 

调用方式:新增一个“PE子站-侧栏菜单”标签:

  1. xml version="1.0" encoding="utf-8"?> 
  2. <root> 
  3.   <LabelType>PE子站类 LabelType> 
  4.   <LabelIntro> 
  5.    LabelIntro> 
  6.   <OutType>txt OutType> 
  7.   <LabelDataType>static LabelDataType> 
  8.   <EnabelAjax>False EnabelAjax> 
  9.   <attributes> 
  10.     <name>outputQty name> 
  11.     <datatype>supersql datatype> 
  12.     <default>9999 default> 
  13.     <intro>输出个数 intro> 
  14.    attributes> 
  15.   <attributes> 
  16.     <name>currentId name> 
  17.     <datatype>supersql datatype> 
  18.     <default>48522 default> 
  19.     <intro>当前节点ID intro> 
  20.    attributes> 
  21.   <LabelTemplate><div id="sideMenu"></span> </span></li> <li style="list-style: decimal-leading-zero outside; border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); line-height: 14px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span class="cdata" style="margin: 0px; padding: 0px; border: none; color: rgb(255, 20, 147); background-color: inherit;">    <div class="hd"></span> </span></li> <li class="alt" style="list-style: decimal-leading-zero outside; border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); color: inherit; line-height: 14px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span class="cdata" style="margin: 0px; padding: 0px; border: none; color: rgb(255, 20, 147); background-color: inherit;">        <h3>{PE.Label id="PE-取得节点名称" nodeid="{PE.Label id="PE取得第N级以上父节点或自身" nodeId="<xsl:value-of select="$currentId"/>" depth="1" /}" /}</h3></span> </span></li> <li style="list-style: decimal-leading-zero outside; border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); line-height: 14px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span class="cdata" style="margin: 0px; padding: 0px; border: none; color: rgb(255, 20, 147); background-color: inherit;">    </div></span> </span></li> <li class="alt" style="list-style: decimal-leading-zero outside; border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); color: inherit; line-height: 14px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span class="cdata" style="margin: 0px; padding: 0px; border: none; color: rgb(255, 20, 147); background-color: inherit;">    <div class="bd"></span> </span></li> <li style="list-style: decimal-leading-zero outside; border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); line-height: 14px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span class="cdata" style="margin: 0px; padding: 0px; border: none; color: rgb(255, 20, 147); background-color: inherit;">        <ul class="menuList"></span> </span></li> <li class="alt" style="list-style: decimal-leading-zero outside; border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); color: inherit; line-height: 14px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span class="cdata" style="margin: 0px; padding: 0px; border: none; color: rgb(255, 20, 147); background-color: inherit;">            {PE.Label id="子栏目列表" hasLi="true" parentId="{PE.Label id="PE取得第N级以上父节点或自身" nodeId="<xsl:value-of select="$currentId"/>" depth="1" /}" currentId="<xsl:value-of select="$currentId"/>" showOnMenu="true" /}</span> </span></li> <li style="list-style: decimal-leading-zero outside; border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); line-height: 14px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span class="cdata" style="margin: 0px; padding: 0px; border: none; color: rgb(255, 20, 147); background-color: inherit;">        </ul></span> </span></li> <li class="alt" style="list-style: decimal-leading-zero outside; border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); color: inherit; line-height: 14px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span class="cdata" style="margin: 0px; padding: 0px; border: none; color: rgb(255, 20, 147); background-color: inherit;">    </div></span> </span></li> <li style="list-style: decimal-leading-zero outside; border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); line-height: 14px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span class="cdata" style="margin: 0px; padding: 0px; border: none; color: rgb(255, 20, 147); background-color: inherit;"></div></span> </span></li> <li class="alt" style="list-style: decimal-leading-zero outside; border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); color: inherit; line-height: 14px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span class="cdata" style="margin: 0px; padding: 0px; border: none; color: rgb(255, 20, 147); background-color: inherit;"><script type="text/javascript">if( jQuery("#sideMenu .bd li").size()==0 ){ jQuery("#sideMenu").hide() }</script> LabelTemplate> 
  22.   <Version officialVersion="" modifiedVersions="4700" compatibleVersion="" /> 
  23. root> 

这样就不会显示出子站的一级菜单了!其实所有列表页都是同一个模板!

×

用户登录