PE取得第N级以上父节点或自身
制作子站的时候,往往子站的侧栏是不需要它自己的“一级栏目”显示出来的,当子站有二级菜单时侧栏才显示,这样就有一个问题了,默认的“侧栏-菜单”,它会显示出子站名称下面的“一级栏目”,因此要做一个标签来判断!其实也就简单的修改了一下“父节点或自身.config”标签!分享下吧!
- xml version="1.0" encoding="utf-8"?>
- <root>
- <LabelType>改进类 LabelType>
- <LabelIntro>父节点或自身 LabelIntro>
- <LabelDataType>sql_sysquery LabelDataType>
- <LabelSqlString>SELECT TOP 1 arrChildID, NodeID,Depth, ParentID FROM PE_Nodes WHERE NodeID = @nodeId order by OrderID LabelSqlString>
- <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 > $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>
- <attributes>
- <name>nodeId name>
- <default>0 default>
- <intro>
- intro>
- attributes>
- <attributes>
- <name>depth name>
- <datatype>string datatype>
- <default>0 default>
- <intro>节点深度 intro>
- attributes>
- <CacheTime>0 CacheTime>
- <OutType>
- OutType>
- root>
调用方式:新增一个“PE子站-侧栏菜单”标签:
- xml version="1.0" encoding="utf-8"?>
- <root>
- <LabelType>PE子站类 LabelType>
- <LabelIntro>
- LabelIntro>
- <OutType>txt OutType>
- <LabelDataType>static LabelDataType>
- <EnabelAjax>False EnabelAjax>
- <attributes>
- <name>outputQty name>
- <datatype>supersql datatype>
- <default>9999 default>
- <intro>输出个数 intro>
- attributes>
- <attributes>
- <name>currentId name>
- <datatype>supersql datatype>
- <default>48522 default>
- <intro>当前节点ID intro>
- attributes>
- <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>
- <Version officialVersion="" modifiedVersions="4700" compatibleVersion="" />
- root>
这样就不会显示出子站的一级菜单了!其实所有列表页都是同一个模板!
用户登录
还没有账号?
立即注册