• Navigation ‘Lists’

    Author
    Topic
    #381487

    In the “Javascript Menus” thread, MarkJ mentioned the Download.com site. On said site, there is a Navigation list at the top of each page of the form
    CNET > Downloads > Windows > Web Authoring > JavaScript
    in which each of the words to the left of JavaScript is a link to a parent page.

    What is this list called?

    How can I incorporate this thing into my sites (without thinking grin)?

    Viewing 1 reply thread
    Author
    Replies
    • #643115

      I believe it is called a hierarchical list – discussed in Post 126095.

      • #643129

        Golly ~ i almost word-for-word duplicated a previous question.

        I guess ‘by hand’ doesnt require thought, as I specified. rofl Gotta be a way to automate this, sort of like the FP sitemap component.

        Thanks, Leif

        • #643135

          Amen, that’s exactly what I am looking to do – automate it with PHP, preferably – so that I don’t need to recode a script every time I add content. If you find something that does the job, shout it out! What would be really nice is a good editor for javascript that doesn’t cost a fortune….I’m sure there are quality editors for this purpose around, but I’ve not found one that I liked yet.

          • #643146

            I am looking for EASY. In my case, easy would mean something along these lines:

            1. some kind of FP component/extension. No thought at all.
            2. some way to get ahold of the FP object model and force it to my will. Unfortunately, there is not a lot of the object model exposed, last I looked.
            3. an ASP script, but that means renaming each page to *.asp.

            But this is being done already, so this should be a no-brainer. I’ll post if i find anything.

            • #643165

              The key to the process is establishing the relationship between pages – Parents and Children.

              You could easily establish a database to store a table of Pages, then a table to designate which pages are Parents, and finally a table to designate which Children pages belong to which Parent pages. Each ASP page will have a Page ID assigned in the page’s code. Then you will lookup the parents of the page, the parents of that page, and so on.

              The specifics may need some work, but the idea is pretty solid.

              HTH

            • #643179

              FP has a database in it somewhere already, so I dont want to duplicate that.

              In the link Leif referenced HOWTO: Automate FrontPage to Create a New Web and Set a Navigation Structure (Q262987), there’s some code that accesses the navigation structure:

              Private Sub ApplyNavigationStructure(oFP As Frontpage.Application)
                Dim oPagewin As Frontpage.PageWindow
                Dim oFPdoc As FrontpageEditor.IHTMLDocument2
                Dim oBot As FrontpageEditor.FPHTMLFrontpageBotElement
                Dim oNavNode As Frontpage.NavigationNode
                
                ' Get the home page navigation node
                Set oNavNode = oFP.ActiveWeb.HomeNavigationNode
                ' Add two children to the home page
                oNavNode.children.Add "temp1.htm", "Child #1 (temp1.htm)", fpStructLeftmostChild
                oNavNode.children.Add "temp2.htm", "Child #2 (temp2.htm)", fpStructRightmostChild
                ' Apply the structure
                oFP.ActiveWeb.ApplyNavigationStructure
                ' Set the shared borders for the current web
                oFP.ActiveWeb.SharedBorders = fpBorderLeft Or fpBorderBottom
               
                ' Load the _borders/left.htm file
                Set oPagewin = oFP.LocatePage(Servername & "/" & FPWebFolder & _
                               "/_borders/left.htm", fpPageViewDefault)
                oPagewin.Activate
                ' Get the Document object
                Set oFPdoc = oPagewin.Document
                ' Look for the "Navigation" webbot
                For Each oBot In oFPdoc.All.tags("webbot")
                  If oBot.getBotAttribute("bot") = "Navigation" Then  
                    ' Add a link to the home page to the navigation bot
                    Call oBot.setBotAttribute("b-include-home", "TRUE")
                  End If
                Next oBot
                ' Save left.htm
                oPagewin.Save
                ' Close the file
                oPagewin.Close
              End Sub
              

              which gives me the hope that i can hack this thing.

              Later, after burga.

            • #643181

              Hi Peter,

              Is your website currently running in a FrontPage environment? If so, your code sounds like a good idea. If not, I just don’t feel comfortable using FrontPage functionality in a non-FP environment.

              The sample you posted gives me an idea – I wonder if the strucure could be kept using an XML source. It matches the XML format almost perfectly – child nodes, parent nodes, etc…

              Editing XML files is not terribly difficult using the MS XML objects…

              Just a thought

            • #643336

              Hi Mark ~

              Yes, ALL of my sites are FP enabled. It’s super easy to let it keep track of pages, links, etc., generation of sitemaps, what’s new, auto database hookup, etc. So my host(s) have to have the FP extensions installed. I find they work best on Windows 2000.

              Now I’m “looking forward to” the .NET thing…

            • #643187

              Hi Peter
              I was delighted to find this site which has “Miscellaneous FrontPage 2000 Macros”. Now I haven’t tried anything except for the Breadcrumb Trail, but after a couple of hitches I’ve got it working well. (And those hitches could be because I have both FP 2002 and FP 2002 on my system. Anyhow – it will use the navigation map as the source of information for the breadcrumb trail.

              So you may save yourself some time.

              Cheers

            • #643337

              That is a TERRIFIC site!

              Thanks, Catherine!

            • #647225

              You can very easily ‘view’ and even edit the navigation from FrontPage itself (through VBA code), so you can create a ‘macro’ to update your site. However, I just recently posted an ASP script that builds a sitemap page from the FrontPages ‘navigation’ data file. It’s not that hard to crack, it’s just a comma seperated text file. (structure.cnf) (I think the folder is ‘_pvt’….heading home, don’t feel like looking it up. But I posted about it in the FP section (Dynamic Site Map). I also posted a VB ActiveX .dll that does the same thing (I think nicer….), but it requires that you can register an ActiveX on your host site.

              Give me a holler if you have any questions on my .asp code.

            • #647441

              Thanks for the tip, Drew. I’ll most likely turn the code into a class before i use it.

              My host doesnt allow much of anything, but i have to admit the servers are solid. The only time we’ve had down time on Parcom.net servers was when the site was under DOS attack.

            • #647445

              Do you mean a Class within ASP? I didn’t think, in fact I am pretty sure ASP won’t let you build a class within the script (at least when using VBScript). I have a VB ActiveX .dll, which IS a set of two classes, which builds from the same information. If you want, I can send it to you. I actually wrote the VB version first, because we host our own site (I host my own site at home too), so I have direct access to the webserver, therefore it’s a snap to use custom ActiveX .dll’s. I have seen hosting companies allow their use also, but not every hosting company does that.

              I wrote the ASP version so that it works as long as ASP is available….no ActiveX required, but since VBScript doesn’t let you build classes or collections, I had to use arrays.

            • #647446

              Yep. Just about everything I write is a class. (Technically, they’re not “classes”; they’re more like “capsules” shrug, but they use the “Class” keyword). These arent necessarily built at runtime, but at design time, and called the same way one calls any “class” : dim x; set x = new XClass; x.method etc.

              You might want to d/l the latest Windows Scripting Technologies documentation from the MS site (I have v5.6).

            • #647450

              I didn’t realize that you could use collections inside VBScript. Go figure. Guess my MSDN is a little out of date.

              It seems that you can’t use Collections though (at least not user defined)….that is true, correct?

              Sort of takes the kick out of being about to create a class.

            • #647555

              ? What kind of data structure do you mean when you say “collection”?

              VBS allows arrays and the use of the Dictionary Object. We market a Stack Class ~ and the other “classic” data structures are fairly easy to do.

            • #647565

              A collection is not a ‘data structure’. It is a collection (for lack of a better word). A collection is like an array, but far more flexible.

              For instance, with an array, it has a fixed size. You can change the size by using Redim, but you have to do that manually. For a collection, you simply use .Add and .Remove. You can get the number of objects in a collection with it’s .Count property.

              A collection also lets you use a For each statement. It also allows for easy sorting. (When you Add an object, it can be added before or after another object. You can also refer to an object in a collection by either it’s index (1 based), or by it’s ID (something you can define when you add an object).

              I have posted an Access database with a complex data structure, that uses Classes and Collections in the Access section of the lounge. If you want to see a collection at work, take a look at that.

            • #647577

              If you like collections, I’d recommend the Dictionary object. It’s like a collection object on steroids. It’s part of the scripting runtime.

            • #647621

              Just took a look at it. It’s not really a collection object on steriods. In fact, the only advantage I see is the .Exists method, which is simple to check by way of erroring with a collection. The RemoveAll method is a waste, with a collection you just set the object to a new collection. It is more like an Array on steriods, because you cannot use a For Each statement, you are still looping it like an array. Also, you don’t have the sorting. When you add an object, you can’t place it before or after an object, only at the end.

              With a collection, you can continuously add items. If you want them sorted by their index, by some property, you just have to do a simple for Each loop until you reach the object your new object should be placed before. Then use that object’s key to place your new object before it. Now ‘reindexing’ everything, the collection handles that all on it’s own. By making it easy to sort by index, you are getting dual sort capabilities. The objects can be ‘retrieved’ in the correct index sort order with a For Next, and they can be retrieved in the correct key sort order by using a for i=1 to MyCollection.Count loop. (Assuming your keys are alphanumeric).

            • #647637

              You might want to read up a little more. I’ve had no problems using a For Each loop with a dictionary object. With a dictionary object, you can return an array of all it’s keys using one method, or return all it’s members as an array, you can overwrite a member value, and I’ve read that it performs faster than a collection.

              Gotta go.

            • #647643

              The documentation I have (5.6) doesn’t show a For Each example, it shows For Next loops only. Is it in the documentation? You can’t do a For Each with an Array, and the docs say that it’s like an array. Haven’t used it myself, so I don’t know.

              Actually, I prefer to use VB ActiveX .dll’s, and then refer to those in ASP. Since the .dll’s are compiled, it runs faster (at least for math stuff), and it’s easy to debug too, since you can use VB to debug your .dll’s if you run the pages through your own IIS server. Since I use VB for most of the programming, I can use everything you can do in VB.

            • #647923

              > The documentation I have (5.6) doesn’t show a For Each example, it shows For Next loops only.
              [indent]


              The Dictionary object is similar to a Collection object, except that it’s loosely based on the Perl associative array. …

              You can access each item stored to a Dictionary object by using the For Each … Next construct. Actually, until recently, it was generally believed that For Each … Next didn’t work with the Dictionary object. But in fact, it does. However, rather than returning a variant containing the data value stored to the Dictionary object as you would expect, it returns a variant containing the key associated with the member. You then have to pass this key to the Item method to retrieve the member…


              [/indent]Matt Childs, Paul Lomax & Ron Petrusha, VBScript in a Nutshell, at 220 (O’Reilly 2000).

              > Is it in the documentation?

              Microsoft’s documentation? laugh

              Incidentally, I have never used the Dictionary object. In VBA, I prefer to create UDTs, so I seldom use the Collection object. I guess I’m just nuts.

            • #647939

              That’s not really acting like a collection then, because you are getting ID’s instead of the actual objects stored.

              Oh well, probably won’t use it anyhow, since I write most of my ASP stuff with VB .dlls anyways.

              You’re not crazy, whatever works as your style is just your style. If you ever follow some of the more heated ‘threads’ I get involved in here and there, I am using defending an independant method of programming/thinking, versus the ‘established’ and ‘approved’ methods.

            • #647226

              Actually #3 isn’t entirely true. If you have access to your IIS server, you can set any file extension you want to be ‘read’ by the asp engine. (I don’t know if hosting companies let you do that or not….but it is possible.).

              Drew

    • #643120

      FWIW – I call it “Breadcrumb navigation” (as in Hansel and Grettel)

      I usually do it manually, unless I’m working in the context of a web Application where I can maintain state using Session Variables…

      • #643134

        Thanks Mark.

        The problem with ‘manual’ is when i start rearranging things. I have one site with > 250pp…

        Viewing all the blank space in the source of the Download.com pages makes me think the navigation is generated with something.

    Viewing 1 reply thread
    Reply To: Navigation ‘Lists’

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: