Display Links

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

    Display Links

    I am a newbie for sure;

    problem,

    I have a page that has dynamically generated sections at the top, when
    I click on one of the sections I would like the list of categories
    associated with the section to display in my left navigation; If I
    click a different section the current navigation list would be
    replaced by the categories associated with the new section I clicked
    on and so on.

    I am sure this is easy for most of you but it is killing me. :-)

    God bless
    jason

  • petersprc

    #2
    Re: Display Links

    You can generate the menu from an array. For example:

    $sections = array(
    'about' =array(
    'team' ='Our Team',
    'directions' ='Directions',
    'history' ='History'
    ),
    'services' =array(
    'design' ='Design',
    'construction' ='Building & Construction',
    'repair' ='Repair'
    )
    )

    To print your menu:

    $currentSection = 'about';
    $contents = $sections[$currentSection];
    foreach ($contents as $dest =$title) {
    $links .= "<li><a href=\"$item\"> $title</a></li>"
    }

    On Jun 13, 11:12 pm, jsd219 <i...@musiclane recording.comwr ote:
    I am a newbie for sure;
    >
    problem,
    >
    I have a page that has dynamically generated sections at the top, when
    I click on one of the sections I would like the list of categories
    associated with the section to display in my left navigation; If I
    click a different section the current navigation list would be
    replaced by the categories associated with the new section I clicked
    on and so on.
    >
    I am sure this is easy for most of you but it is killing me. :-)
    >
    God bless
    jason

    Comment

    • jsd219

      #3
      Re: Display Links

      On Jun 13, 11:25 pm, petersprc <peters...@gmai l.comwrote:
      You can generate the menu from an array. For example:
      >
      $sections = array(
      'about' =array(
      'team' ='Our Team',
      'directions' ='Directions',
      'history' ='History'
      ),
      'services' =array(
      'design' ='Design',
      'construction' ='Building & Construction',
      'repair' ='Repair'
      )
      )
      >
      To print your menu:
      >
      $currentSection = 'about';
      $contents = $sections[$currentSection];
      foreach ($contents as $dest =$title) {
      $links .= "<li><a href=\"$item\"> $title</a></li>"
      >
      }
      >
      On Jun 13, 11:12 pm, jsd219 <i...@musiclane recording.comwr ote:
      >
      I am a newbie for sure;
      >
      problem,
      >
      I have a page that has dynamically generated sections at the top, when
      I click on one of the sections I would like the list of categories
      associated with the section to display in my left navigation; If I
      click a different section the current navigation list would be
      replaced by the categories associated with the new section I clicked
      on and so on.
      >
      I am sure this is easy for most of you but it is killing me. :-)
      >
      God bless
      jason
      I don't quite follow, :-) if you go to: http://www(dot)discbid(dot)net
      you can see what i am talking about. notice the section at the top
      next to catalog. It currently has 7 entries, camryn, deda,
      grandpa...but it can change. it is dynamically generated so the client
      can add to or take away any of these sections. when you click on one
      of the sections, the navigation bar at the left should populate with
      all the categories created under that section, this too is dynamically
      generated and can change.

      Any and all help is greatly appreciated

      God bless
      jason

      Comment

      • Jeff North

        #4
        Re: Display Links

        On Thu, 14 Jun 2007 03:12:57 -0000, in comp.lang.php jsd219
        <info@musiclane recording.com>
        <1181790777.998 461.231250@i13g 2000prf.googleg roups.comwrote:
        >| I am a newbie for sure;
        >|
        >| problem,
        >|
        >| I have a page that has dynamically generated sections at the top, when
        >| I click on one of the sections I would like the list of categories
        >| associated with the section to display in my left navigation; If I
        >| click a different section the current navigation list would be
        >| replaced by the categories associated with the new section I clicked
        >| on and so on.
        >|
        >| I am sure this is easy for most of you but it is killing me. :-)
        >|
        >| God bless
        >| jason
        This sounds like a perfect application for AJAX.
        I've emailed you the zipped files that I hope you will find useful.
        ---------------------------------------------------------------
        jnorthau@yourpa ntsyahoo.com.au : Remove your pants to reply
        ---------------------------------------------------------------

        Comment

        • Jerry Stuckle

          #5
          Re: Display Links

          jsd219 wrote:
          On Jun 13, 11:25 pm, petersprc <peters...@gmai l.comwrote:
          >You can generate the menu from an array. For example:
          >>
          >$sections = array(
          > 'about' =array(
          > 'team' ='Our Team',
          > 'directions' ='Directions',
          > 'history' ='History'
          > ),
          > 'services' =array(
          > 'design' ='Design',
          > 'construction' ='Building & Construction',
          > 'repair' ='Repair'
          > )
          >)
          >>
          >To print your menu:
          >>
          >$currentSectio n = 'about';
          >$contents = $sections[$currentSection];
          >foreach ($contents as $dest =$title) {
          > $links .= "<li><a href=\"$item\"> $title</a></li>"
          >>
          >}
          >>
          >On Jun 13, 11:12 pm, jsd219 <i...@musiclane recording.comwr ote:
          >>
          >>I am a newbie for sure;
          >>problem,
          >>I have a page that has dynamically generated sections at the top, when
          >>I click on one of the sections I would like the list of categories
          >>associated with the section to display in my left navigation; If I
          >>click a different section the current navigation list would be
          >>replaced by the categories associated with the new section I clicked
          >>on and so on.
          >>I am sure this is easy for most of you but it is killing me. :-)
          >>God bless
          >>jason
          >
          I don't quite follow, :-) if you go to: http://www(dot)discbid(dot)net
          you can see what i am talking about. notice the section at the top
          next to catalog. It currently has 7 entries, camryn, deda,
          grandpa...but it can change. it is dynamically generated so the client
          can add to or take away any of these sections. when you click on one
          of the sections, the navigation bar at the left should populate with
          all the categories created under that section, this too is dynamically
          generated and can change.
          >
          Any and all help is greatly appreciated
          >
          God bless
          jason
          >
          Jason,

          As Peter indicated, you need to generate the menu items dynamically.
          When the user clicks on the top section, your code needs to handle the
          change.

          Basically in your case the link should be directed back at the same
          page. Look at which parameter was passed (if any - the first time there
          won't be a parameter) and build the appropriate menu. Then output the
          entire page again.


          --
          =============== ===
          Remove the "x" from my email address
          Jerry Stuckle
          JDS Computer Training Corp.
          jstucklex@attgl obal.net
          =============== ===

          Comment

          Working...