I am not sure if this is a bug, but when I view source on the <ul> <li> items being produced by the GenericNav tag the tags do not appear to be properly nested, yet the DHTML menus still work fine. Therefore I am not sure if this unusual nesting of the tags is intentional or not. I should note that I am working with 4 levels of nesting in the menu.
I discovered the situation while trying to make a vertical CSS only pop out menu. In order to get my menu working as expected I rewrote the tag. I am including the code if anyone is interested. The included code is combatable with just about any of the CSS sheets provided by Stu Nichols http://www.cssplay.co.uk/menus/, or you can remove the commented html within the <ul>s and use the csshover.htc and or the listapart js (to get IE working) method ,and also works with the default menus. I am writing custom code within the "CORE" section to replace the genericNav. Is it a bad thing to write custom code in the CORE? and, is messing with this file likely to have unforeseen repercussion in other areas that , as a noob, I am yet to become aware of. <cfsetting enablecfoutputonly="yes" /> <cfprocessingdirective suppresswhitespace="true"> <!--- allow developers to close custom tag by exiting on end ---> <cfif thistag.ExecutionMode eq "end"> <cfexit method="exittag" /> </cfif> <cfif isDefined("request.ver") and request.ver> <cfoutput><!-- _genericNav $Revision: 1.2.2.4 $ --></cfoutput> </cfif> <cfparam name="attributes.navID" default="#request.navID#"> <cfparam name="attributes.depth" default="1"> <cfparam name="attributes.startLevel" default="2"> <cfparam name="attributes.id" default=""> <cfparam name="attributes.bFirst" default="0"> <cfparam name="attributes.bLast" default="0"> <cfparam name="attributes.bActive" default="0"> <cfparam name="attributes.bIncludeHome" default="0"> <cfparam name="attributes.sectionObjectID" default="#request.navID#"> <cfparam name="attributes.functionMethod" default="getDescendants"> <cfparam name="attributes.functionArgs" default="depth=#attributes.depth#"> <cfparam name="attributes.bDump" default="0"> <cfparam name="attributes.class" default=""> <cfparam name="attributes.style" default=""> <cfparam name="request.sectionObjectID" default="#request.navID#"> <cfparam name="attributes.displayStyle" default="unorderedList"> <cfparam name="attributes.bHideSecuredNodes" default="0"><!--- MJB: check if option to Hide Nav Node Items that user does't have permission to access: default to 0 for backward compatibility ---> <cfparam name="attributes.afilter" default="#arrayNew(1)#"> <cfif application.config.plugins.fu> <cfset fu = createObject("component","#application.packagepath#.farcry.fu")> </cfif> <!--- // get navigation items ---> <cfset o = createObject("component", "#application.packagepath#.farcry.tree")> <cfset navFilter=duplicate(attributes.afilter)> <cfset arrayAppend(navFilter, "status IN (#listQualify(request.mode.lvalidstatus, '''')#)") /> <cfset qNav = evaluate("o."&attributes.functionMethod&"(objectid=attributes.navID, lColumns='externallink', "&attributes.functionArgs&", afilter=navFilter)")> <cfimport taglib="/farcry/core/tags/webskin" prefix="nav"> <!--- // get ansestors of attributes.navID ---> <cfset qAncestors = o.getAncestors(attributes.sectionObjectID)> <cfset lAncestors = valuelist(qAncestors.objectid)> <cfif attributes.bIncludeHome> <!--- // get application.navid.home objectName ---> <cfset homeNode = o.getNode(objectID=#application.navid.home#)> </cfif> <cfif attributes.bLast> <!--- here we get the most right nav so we can add a last class to it if needed ---> <cfquery name="qMaxRight" dbtype="query"> select max(nRight) as maxRight from qNav </cfquery> </cfif> <cffunction name="dump"> <cfargument name="arg"> <cfdump var="#arg#"> <cfabort/> </cffunction> <cfif attributes.displayStyle EQ "aLink"> <cfloop query="qNav"> <cfif application.config.plugins.fu> <cfset strhref = fu.getFU(qNav.objectid)> <cfelse> <cfset strhref = application.url.conjurer & "?objectid=" & qNav.objectid> </cfif> <cfif qNav.currentRow GT 1> <cfoutput> | </cfoutput> </cfif> <cfoutput><a href="#strhref#" title="#qNav.objectName#">#qNav.objectName#</a></cfoutput> </cfloop> <cfelse> <!--- determine the policy groups (or roles) this user belongs to ---> <cfif isDefined("session.dmsec.authentication.lPolicyGroupIDs") and listLen(session.dmsec.authentication.lPolicyGroupIDs)> <!--- concatenate logged in group permissions with anonymous group permissions ---> <cfset lpolicyGroupIds = session.dmsec.authentication.lPolicyGroupIDs & "," & application.dmsec.ldefaultpolicygroups> <cfelse> <!--- user not logged in, assume anonymous permissions ---> <cfset lpolicyGroupIds = application.dmsec.ldefaultpolicygroups> </cfif> <!---cfdump var="#attributes#"---> <!---Test---> <cfset nodes = ''/> <cfloop from="1" to="#qNav.recordCount#" index="i"> <cfif attributes.bHideSecuredNodes EQ 0> <cfset iHasViewPermission = 1> <cfelse> <cfset iHasViewPermission = request.dmsec.oAuthorisation.checkInheritedPermission(objectid=qNav.ObjectID[i],permissionName="View",lpolicyGroupIds=lpolicyGroupIds) / > </cfif> <cfif iHasViewPermission EQ 1> <!---check for external links---> <cfif structkeyexists(qNav,'externallink') and len(qNav.externallink[i])> <cfset object = trim(qNav.externallink[i])> <cfelse> <cfset object = trim(qNav.ObjectID[i]) /> </cfif> <!---check for freindly URLs---> <cfif application.config.plugins.fu> <cfset href = fu.getFU(object) /> <cfelse> <cfset href = application.url.conjurer & "?objectid=" & object /> </cfif> <cfset itemclass='' /> <cfif qNav.nLevel[i] lt attributes.startlevel+attributes.depth - 1 and qNav.nRight[i]-qNav.nleft[i] neq 1> <cfset itemclass=itemclass & 'parent ' /> </cfif> <cfif i eq 1 and attributes.bFirst> <cfset itemclass=itemclass & 'first ' /> </cfif> <!---this means it is the last column in nav---> <cfif attributes.bLast and qNav.nRight[i] eq qMaxRight.maxRight> <cfset itemclass=itemclass & 'last ' /> </cfif> <cfif attributes.bActive and (trim(qNav.ObjectID[i]) eq request.sectionObjectID or listfind(lAncestors, trim(qNav.ObjectID[i])))> <cfset itemclass=itemclass & 'active ' /> </cfif> <cfif (qNav.nLevel[i] eq attributes.startLevel) AND (i EQ 1)><!--- first node---> <cfset css_hook = "" /> <cfif len(attributes.id)> <cfset css_hook = css_hook & "id='#attributes.id#'" /> </cfif> <cfif len(attributes.class)> <cfset css_hook = css_hook & "class='#attributes.class#'" /> </cfif> <cfif len(attributes.style)> <cfset css_hook = css_hook & "style='#attributes.style#'" /> </cfif> <cfset nodes = nodes & '<ul #css_hook#>' /> <!---include home if requested---> <cfif attributes.bIncludeHome> <cfset homeLink = '<li' /> <cfif request.sectionObjectID eq application.navid.home> <cfset homeLink = homeLink & " class='active home'" /> </cfif> <cfset homelink = homelink & "><a href=""#application.url.webroot#/"">#homeNode.objectName#</a></li>"/> <cfset nodes = nodes & homelink /> </cfif> <cfset nodes = nodes & '<li>'& '<a href="#href#">#trim(qNav.ObjectName[i])#' /> </cfif> <cfif qNav.nLevel[i +1] LTE attributes.depth + 1> <cfif qNav.nLevel[i +1] EQ qNav.nLevel[i]><!---node on same level close previous, open new---> <cfset nodes = nodes & '</a></li><li class="#trim(itemclass)#">'& '<a href="#href#">#trim(qNav.ObjectName[i+1])#' /> </cfif> <cfif qNav.nLevel[i +1] GT qNav.nLevel[i]><!---next level is one step down nested level---> <cfset nodes = nodes & '<!--[if IE 7]><!--></a><!--<![endif]-- ><!--[if lte IE 6]><table><tr><td><![endif]--><ul><li class="#trim(itemclass)#">'& '<a href="#href#">#trim(qNav.ObjectName[i +1])#' > </cfif> <cfif (qNav.nLevel[i +1] LT qNav.nLevel[i]) AND (i NEQ #qNav.recordCount#)> <cfset nodesBack = (qNav.nLevel[i] - qNav.nLevel[i+1]) /><!---go up to proper nLevel level - diff between currentLevel and root---> <cfset nodes = nodes & '</a>' /> <cfset nodes = nodes & '#repeatString('</li></ul><!--[if lte IE 6]></td></tr></table></a><![endif]-->', nodesBack)#</li><li class="#trim(itemclass)#">'&'<a href="#href#">#trim(qNav.ObjectName[i +1])#'/> </cfif> </cfif> <cfif i EQ qNav.recordCount> <cfset nodes = nodes & '</a></li></ul>'> </cfif> </cfif> </cfloop> <cfoutput> #nodes# </cfoutput> </cfif> </cfprocessingdirective> <cfsetting enablecfoutputonly="no" /> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "farcry-dev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/farcry-dev?hl=en -~----------~----~----~----~------~----~------~--~---
