Compagniee-ShopProduitsServicesInformations & EvénementsCarrièresContacts
<% On Error resume next dim my_id dim title_start dim title_keywords dim title_PageTitle dim title_ContentObject dim title_metaTag dim inf_languagecode dim hasContentMetaTitle dim strSiteArea dim intCurrentDepth function getEtrackerName() if title_ContentObject <> "" then getEtrackerName = title_PageTitle & " - " & title_ContentObject else getEtrackerName = title_PageTitle end if end function function getEtrackerAreas() getEtrackerAreas = "maxon portal/MMAG/FRS/" & strSiteArea end function sub setSiteArea(strArea) strSiteArea = strArea end sub sub setcurrentDepth(nDepth) intCurrentDepth = nDepth end sub ' Save the RedDot-Page-ID of current page in my_id. ' Each page builds the menu structure by finding the own ID in the xml. inf_languagecode = "FRS" hasContentMetaTitle = "" intCurrentDepth = 0 title_start = "maxon motor suisse" title_keywords = "Communiqués de Presse" title_PageTitle = "Communiqués de Presse" title_ContentObject = getMetaTitle() title_metaTag = "maxon motor" if (title_start <> "") then title_metaTag = title_start if (title_ContentObject <> "") then if (title_keywords <> "") then title_metaTag = title_metaTag & " " & title_keywords end if if (title_PageTitle<> "") then title_metaTag = title_metaTag & " " & title_PageTitle end if title_metaTag = title_metaTag & " " & title_ContentObject else if (title_keywords <> "") then title_metaTag = title_metaTag & " " & title_keywords end if if (title_PageTitle<> "") then title_metaTag = title_metaTag & " " & title_PageTitle end if end if my_id = "1B8A335B870149D98F8D30FE23161C7F" %> <!IoRangePreExecute><%=title_metaTag%><!/IoRangePreExecute>
<% '------------------------------------------------------------------------------ ' Alle Rechte vorbehalten. ' Entwickler: Marcus Taegtmeyer ' Firma: Fa. RedDot Solutions AG, Oldenburg, Germany ' Projekt: Navigations ' Modulname: Menu ASP ' Subsystem: RedDot CMS Professional 5.5 or higher ' Copyright (c) RedDot Solutions AG 2004 '------------------------------------------------------------------------------ ' Revision: $Revision:$ ' $State: $ ' $Name: $ '------------------------------------------------------------------------------ ' Description: Creates dynamic Navigation; use Edit-Variant to expand, ' Run-Variant to use. '------------------------------------------------------------------------------ ' Disclaimer Dieses Skript ist kein offizieller Bestandteil der RedDot ' Content Management Software. Die RedDot Solutions AG übernimmt ' für dieses Skript keinerlei Gewährleistung und haftet nicht für ' eventuelle durch den Einsatz des Skriptes entstehenden Schäden ' und deren Folgeschäden. ' Das Skript wird nicht von der RedDot Solutions AG supportet. ' Alle Hinweise zu der Funktion des Skripts sind unverbindlich ' und werden nicht von der RedDot Solutions AG garantiert. Alle ' Rechte an diesem Script stehen der RedDot Solutions AG zu. ' Dieses Skript wird kostenlos zur Verfügung gestellt und darf ' nicht weiterverkauft werden '------------------------------------------------------------------------------ ' maximum depth dim maxdepth maxdepth = 5 ' xml String, that will contain the menu structure dim xml ' xmlDoc will contain the DOM-Object of xml dim xmlDoc ' rootNode is the rootNode of the xml dim rootNode ' success is the flag, that indicates, if the matching ID has been found dim success ' global path contains a string with each node's content that has been passed to reach the matchig node. dim global_path ' link will be each item's Properties (linkname|url_of_following_page|page_id_of_following_page) dim link ' link_string is an array with all links in it dim link_string ' link_details is an array of each link dim link_details ' detail is each value of each link ' n and m are counter variables dim detail, n, m ' my_path(n,0): linkname, my_path(n,1): url_of_following_page, my_path(n,2): ID; limits number of levels to 10 dim my_path(9,2) dim activeLink ' 1. read xml-structure to xml xml = "" & vbcrlf & "" &_ "" + _ "" + "" + "" + _ "" + "" + _ "" + _ "" + "" + _ "" + "" + _ "" + "" + _ "" + "" + _ "" + "" + _ "" + "" + _ "" + "" + _ "" + "" + _ "" + _ "" + _ "" + _ "" + _ "" + "" + "" + "" + _ "" + "" + _ "" + _ "" + "" + "" + _ "" + "" + _ "" + "" + _ "" + _ "" + "" + _ "" + "" + _ "" + "" + _ "" + "" + _ "" + "" + _ "" + "" + _ "" + _ "" + "" + _ "" + "" + _ "" + _ "" + _ "" + "" + _ "" + "" + _ "" + "" + _ "" + _ "" + _ "" + "" + _ "" + "" + _ "" + "" + _ "" + "" + _ "" + "" + _ "" + _ "" + _ "" + "" + _ "" + _ "" + _ "" + "" + _ "" + "" + _ "" + "" + _ "" + _ "" ' 2. Load structure into DOM-Object Set xmlDoc = Server.CreateObject("MSXML.DOMDocument") XMLDoc.async = False success = xmlDoc.loadxml(xml) ' 2.a Check for errors! If Not success Then Response.Write "Could not load the XML document!" Else ' 3. Start! Set Root Node to Root of XML Set rootNode = XMLDoc.documentElement ' 4. Find own ID in xml-tree call SearchNode(rootNode,1, "") ' 4.a ID found! Global variable global_path now contains path to active link ' 5. Extract path(n,m) from global_path n=0 m=0 link_string = split(global_path,"||") for Each link in link_string link_details = split(link, "|") For Each detail in link_details my_path(n,m)=detail m=m+1 next m=0 n=n+1 next ' 5.a path to active link now in path(n,m) ' 6. Output the breadcrump-path now! ' call OutputPath(rootNode,1) End If ' Function to find the own Page ID in the xml-tree; writes data into global_path Function SearchNode(ByVal node, ByVal nDepth, ByVal path) dim item ' Check, if this is the main menu-item. If not, go on. if node.nodeName <> "menu" Then ' Save this items values into path. path = path & node.attributes(0).value & "|" & node.attributes(1).value & "|" & node.attributes(2).value & "||" ' If this node is the one with my id write global_path if node.attributes(1).value = my_id then global_path = path 'found matching link end if End if ' If one of this node's children is the one with my id write global_path For Each item in node.childNodes if item.nodeName="item" then if item.attributes(1).value = my_id and maxdepth > ndepth then 'found active link global_path = path & item.attributes(0).value & "|" & item.attributes(1).value & "|" & item.attributes(2).value & "||" exit function end if end if ' Look into substructures, call this function again and give it the so far collected path-informations If item.hasChildNodes() Then call SearchNode(item,nDepth+1, path) 'recursive call of OutputNode for deeper structure End If Next End Function ' Function to write the breadcrumbs Function OutputPath(ByVal node, ByVal nDepth) 'Write Menu-Entries into page dim item dim counter ' If this node is the one, with my_id as page_id write it For Each item in node.childNodes if item.nodeName="item" then if item.attributes(1).value = my_id then 'found active link setcurrentDepth(nDepth) response.write "" & unescape(item.attributes(0).value) & "" ' Else if this node is part of my path write it elseif item.hasChildNodes() and item.attributes(1).value = my_path(nDepth-1,1) and maxdepth > ndepth Then response.write "" & unescape(item.attributes(0).value) & "  " ' Check the next level call OutputPath(item,nDepth+1) 'recursive call of OutputNode for deeper structure End If End If Next End Function Function RewriteImageText(ByVal strImgText) strImgText= Lcase(strImgText) strImgText= replace(strImgText, "
", " ") strImgText= replace(strImgText, "

", " ") strImgText= replace(strImgText, "

", " ") strImgText= replace(strImgText, "", "") strImgText= replace(strImgText, "", "") RewriteImageText = strImgText End Function ' Write Menu Structure for toplevel Function OutputTopLevel(ByVal node, ByVal nDepth) 'Write Menu-Entries into page dim item dim counter ' Check each child node For Each item in node.childNodes if item.nodeName="item" then ' Check, if this link is to be highlighted if item.attributes(1).value = my_id or item.attributes(1).value = my_path(nDepth-1,1) then 'found active link; use or item.attributes(1).value = my_path(nDepth-1,1) if whole path should be highlighted ' Write highlighted link setSiteArea(unescape(item.attributes(0).value)) response.write "" & unescape(item.attributes(0).value) & "" elseif not item.attributes(1).value = my_path(nDepth-1,1) then 'found inactive link ' Write normal link ' use if not item.attributes(1).value = my_path(nDepth-1,1) then if whole path should be highlighted response.write "" & unescape(item.attributes(0).value) & "" end if end if Next End Function call OutputTopLevel(rootNode,1) %>
<%ShowLangSelection=true%>
<% if ("http://www.maxonmotor.ch/medienmiteilungen-ch-deu_5619.html" = "") then nav_lv_link = "http://www.maxonmotor.ch/index.htm" else nav_lv_link = "http://www.maxonmotor.ch/medienmiteilungen-ch-deu_5619.html" end if %> Deutsch /