design question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • headware

    design question

    Hi, I have a general design questions. I'm making a site that has two
    frames, one on the left for navigational menus and one on the right
    for displaying the contents of the site. I want some of the menu items
    on the left to expand dynamically and display sub items when the user
    clicks on them. So they might show something like this:


    item 1
    item 2
    item 3

    then when you click on item 2 you get this:

    item 1
    item 2
    sub item 2.1
    sub item 2.2
    item 3

    I was going to put all the javascript in just the menu pages so that
    when you click on one of the expandable menu items, it loads another
    static page into the left frame with that menu item expanded. I know
    that may not be the best solution especially if we decide to have more
    than one expandable menu item, but that's the way it's going to work
    for now.
    This would have worked fine except that some pages allow the user
    to access other pages without using menu on the left. The problem
    there is that if a page that isn't part of an expanded menu item takes
    you to another page that *is* part of an expanded menu item, the menu
    won't expand, since the javascript only runs if you click the menu
    item hyperlinks in the left pane.
    This problem can be solved in at least a few ways. I could take the
    javascript out of the menu pages and put it in the onLoad event of
    every display page so that when that page displays, it changes the
    left frame to display the proper menu for that page (expanded or
    collapsed). Or I could connect the javascript to the hyperlinks that
    move you from pages with collapsed menus to pages with expanded menus.
    Neither of those solutions sounds all that good because every time you
    right a new page you have to remember to put the javascript in there
    if it's going to affect the menu frame. Is there any other way of
    doing this that I might be missing? Something that won't turn into a
    maintenance nightmare?

    Thanks
  • headware

    #2
    Re: design question

    Unfortunately I don't have a choice.

    William Starr Moake <wsmoake@yahoo. com> wrote in message news:<vaeugv4gb i5f4dmvgp95a87h hr7oabvfi0@4ax. com>...[color=blue]
    > The instant I read the word "frames" my eyes glaze over, my brain
    > turns to oatmeal and drool runs down my slack jaw. Don't use 'em.
    > Don't want to read about anyone else who does.
    >
    >
    > On 11 Jul 2003 10:51:17 -0700, headware@aol.co m (headware) wrote:
    >[color=green]
    > >Hi, I have a general design questions. I'm making a site that has two
    > >frames, one on the left for navigational menus and one on the right
    > >for displaying the contents of the site. I want some of the menu items
    > >on the left to expand dynamically and display sub items when the user
    > >clicks on them. So they might show something like this:
    > >
    > >
    > >item 1
    > >item 2
    > >item 3
    > >
    > >then when you click on item 2 you get this:
    > >
    > >item 1
    > >item 2
    > > sub item 2.1
    > > sub item 2.2
    > >item 3
    > >
    > >I was going to put all the javascript in just the menu pages so that
    > >when you click on one of the expandable menu items, it loads another
    > >static page into the left frame with that menu item expanded. I know
    > >that may not be the best solution especially if we decide to have more
    > >than one expandable menu item, but that's the way it's going to work
    > >for now.
    > > This would have worked fine except that some pages allow the user
    > >to access other pages without using menu on the left. The problem
    > >there is that if a page that isn't part of an expanded menu item takes
    > >you to another page that *is* part of an expanded menu item, the menu
    > >won't expand, since the javascript only runs if you click the menu
    > >item hyperlinks in the left pane.
    > > This problem can be solved in at least a few ways. I could take the
    > >javascript out of the menu pages and put it in the onLoad event of
    > >every display page so that when that page displays, it changes the
    > >left frame to display the proper menu for that page (expanded or
    > >collapsed). Or I could connect the javascript to the hyperlinks that
    > >move you from pages with collapsed menus to pages with expanded menus.
    > >Neither of those solutions sounds all that good because every time you
    > >right a new page you have to remember to put the javascript in there
    > >if it's going to affect the menu frame. Is there any other way of
    > >doing this that I might be missing? Something that won't turn into a
    > >maintenance nightmare?
    > >
    > >Thanks[/color][/color]

    Comment

    • Dom Leonard

      #3
      Re: design question

      headware wrote:[color=blue]
      > Hi, I have a general design questions. I'm making a site that has two
      > frames, one on the left for navigational menus and one on the right
      > for displaying the contents of the site.[/color]
      <snip>[color=blue]
      > This would have worked fine except that some pages allow the user
      > to access other pages without using menu on the left. The problem
      > there is that if a page that isn't part of an expanded menu item takes
      > you to another page that *is* part of an expanded menu item, the menu
      > won't expand, since the javascript only runs if you click the menu
      > item hyperlinks in the left pane.
      > This problem can be solved in at least a few ways. I could take the
      > javascript out of the menu pages and put it in the onLoad event of
      > every display page so that when that page displays, it changes the
      > left frame to display the proper menu for that page (expanded or
      > collapsed).[/color]
      This has potential in that pages could include common code to cause menu
      update based on their URL. I would not, however, attempt to get document
      page code to *perform* menu update. More some kind of notification to
      let frameset or contents page code know that the document frame URL has
      changed.

      Or I could connect the javascript to the hyperlinks that[color=blue]
      > move you from pages with collapsed menus to pages with expanded menus.[/color]
      Bad idea, no disagreement. Horrible maintenance problem.
      [color=blue]
      > Neither of those solutions sounds all that good because every time you
      > right a new page you have to remember to put the javascript in there
      > if it's going to affect the menu frame. Is there any other way of
      > doing this that I might be missing?[/color]
      I have used the 'notification' solution with no action taken if the
      notified URL is not in the menu. Essentially common menu interface code
      goes in a template file for frameset documents.

      Another idea might be to run a timer script in either the frameset or
      contents page which checks for *changes* in the url of the document
      frame, and if an inactive menu link points to it, update the menu frame.
      This suggests even static menu pages loaded from the server need to know
      where hidden menu links lead.

      There might be a small delay before menus update themselves (which is
      exactly what I think menus should do) but this might actually be better
      than page loading scripts using a notification scheme - clicking a menu
      item to load a document frame can cause duplicate tracking if menu item
      click and page loading both trigger contents tracking without additional
      code to prevent the duplication.

      Obviously a fully expanded contents page should be loaded initially by
      the frameset for use in javascript disabled browsers.


      Hope it helps,
      Dom






      Comment

      • headware

        #4
        Re: design question

        Thanks for the reply. Those are good suggestions. But, why do you
        think it's a bad idea for the document page to do the actual changing
        of the menu page? All it would really require is some simple code like

        parent.menu.loc ation = "MyMenu.asp x";

        Do you think this could lead to maintenance issues?

        Thanks,
        Dave

        Dom Leonard <doml.removethi s@senet.andthis .com.au> wrote in message news:<YBxQa.212 $O05.10660@nnrp 1.ozemail.com.a u>...[color=blue]
        > headware wrote:[color=green]
        > > Hi, I have a general design questions. I'm making a site that has two
        > > frames, one on the left for navigational menus and one on the right
        > > for displaying the contents of the site.[/color]
        > <snip>[color=green]
        > > This would have worked fine except that some pages allow the user
        > > to access other pages without using menu on the left. The problem
        > > there is that if a page that isn't part of an expanded menu item takes
        > > you to another page that *is* part of an expanded menu item, the menu
        > > won't expand, since the javascript only runs if you click the menu
        > > item hyperlinks in the left pane.
        > > This problem can be solved in at least a few ways. I could take the
        > > javascript out of the menu pages and put it in the onLoad event of
        > > every display page so that when that page displays, it changes the
        > > left frame to display the proper menu for that page (expanded or
        > > collapsed).[/color]
        > This has potential in that pages could include common code to cause menu
        > update based on their URL. I would not, however, attempt to get document
        > page code to *perform* menu update. More some kind of notification to
        > let frameset or contents page code know that the document frame URL has
        > changed.
        >
        > Or I could connect the javascript to the hyperlinks that[color=green]
        > > move you from pages with collapsed menus to pages with expanded menus.[/color]
        > Bad idea, no disagreement. Horrible maintenance problem.
        >[color=green]
        > > Neither of those solutions sounds all that good because every time you
        > > right a new page you have to remember to put the javascript in there
        > > if it's going to affect the menu frame. Is there any other way of
        > > doing this that I might be missing?[/color]
        > I have used the 'notification' solution with no action taken if the
        > notified URL is not in the menu. Essentially common menu interface code
        > goes in a template file for frameset documents.
        >
        > Another idea might be to run a timer script in either the frameset or
        > contents page which checks for *changes* in the url of the document
        > frame, and if an inactive menu link points to it, update the menu frame.
        > This suggests even static menu pages loaded from the server need to know
        > where hidden menu links lead.
        >
        > There might be a small delay before menus update themselves (which is
        > exactly what I think menus should do) but this might actually be better
        > than page loading scripts using a notification scheme - clicking a menu
        > item to load a document frame can cause duplicate tracking if menu item
        > click and page loading both trigger contents tracking without additional
        > code to prevent the duplication.
        >
        > Obviously a fully expanded contents page should be loaded initially by
        > the frameset for use in javascript disabled browsers.
        >
        >
        > Hope it helps,
        > Dom[/color]

        Comment

        • Dom Leonard

          #5
          Re: design question

          headware wrote:[color=blue]
          > Thanks for the reply. Those are good suggestions. But, why do you
          > think it's a bad idea for the document page to do the actual changing
          > of the menu page? All it would really require is some simple code like
          >
          > parent.menu.loc ation = "MyMenu.asp x";
          >
          > Do you think this could lead to maintenance issues?
          >[/color]

          In the sense that the document page has hard links to its associated
          menu page, yes. I think it preferable for javascript code to derive the
          menu page from parsing the document URL in which the code is running.

          So if the document url looks like "http://...blah.../page1.html
          and code parses out the 'page1' bit into a pageName variable, the above
          code might become

          parent.menu.loc ation = pageName + "Menu.aspx" ; // or
          parent.menu.loc ation = "sendMenu.asp?c aller=pageName" ;

          A common javascript file can then be included in document pages to
          update the menu. Hard coding may be fine for a few pages, but does not
          scale well and requires the navigation system to stay constant.

          I have found a common .js file is a good idea anyway. I wanted to add a
          frame breakout script? Reload under Netscape 4.xx after resize? Create
          and add a document footer element? Easy with a common file :)

          Cheers,
          Dom

          Comment

          • headware

            #6
            Re: design question

            I see. Yeah those are good ideas. Thanks for the help.

            Dave


            Dom Leonard <doml.removethi s@senet.andthis .com.au> wrote in message news:<fy1Ra.14$ FZ6.1755@nnrp1. ozemail.com.au> ...[color=blue]
            > headware wrote:[color=green]
            > > Thanks for the reply. Those are good suggestions. But, why do you
            > > think it's a bad idea for the document page to do the actual changing
            > > of the menu page? All it would really require is some simple code like
            > >
            > > parent.menu.loc ation = "MyMenu.asp x";
            > >
            > > Do you think this could lead to maintenance issues?
            > >[/color]
            >
            > In the sense that the document page has hard links to its associated
            > menu page, yes. I think it preferable for javascript code to derive the
            > menu page from parsing the document URL in which the code is running.
            >
            > So if the document url looks like "http://...blah.../page1.html
            > and code parses out the 'page1' bit into a pageName variable, the above
            > code might become
            >
            > parent.menu.loc ation = pageName + "Menu.aspx" ; // or
            > parent.menu.loc ation = "sendMenu.asp?c aller=pageName" ;
            >
            > A common javascript file can then be included in document pages to
            > update the menu. Hard coding may be fine for a few pages, but does not
            > scale well and requires the navigation system to stay constant.
            >
            > I have found a common .js file is a good idea anyway. I wanted to add a
            > frame breakout script? Reload under Netscape 4.xx after resize? Create
            > and add a document footer element? Easy with a common file :)
            >
            > Cheers,
            > Dom[/color]

            Comment

            Working...