2 Replies Latest reply: Jan 13, 2012 5:48 PM by Ben Pleysier RSS

    Using Templates for Navigation area

    rigoliarts Community Member

      Using Dreamweaver CS5 on a mac OS 10.6.8

       

      If I create a template with the navigation buttons as part of the fixed template and not an editable region, then any changes I need to make to the menu will apply to all the pages made from the template (correct?)

       

      I want to make a class called current to indicate what page the viewer is on, but in order to do that, then the navigation area needs to be in an editable region.

       

      But that makes it so that I cannot make global sitewide changes to the navigation area if it's in a editable region, right?

       

      So, the question is... how can I make future changes to the navigation area that will update sitewide and still be able to apply a current page class?

       

      Thanks,

      Diane

        • 1. Re: Using Templates for Navigation area
          MurraySummers CommunityMVP

          If I create a template with the navigation buttons as part of the fixed template and not an editable region, then any changes I need to make to the menu will apply to all the pages made from the template (correct?)

           

          Yes.

           

          I want to make a class called current to indicate what page the viewer is on, but in order to do that, then the navigation area needs to be in an editable region.

           

          Not at all.  Think about this - give each desired navigation element a unique name, for example -

           

          <li><a href="/" id="home"....

          <li><a href="whatever" id="whatever"....

           

          Then, on each child page, put a small embedded stylesheet in the editable region in the head that targets the desired button in the nav element, e.g.,

           

          <!-- InstanceBeginEditable name="head" -->

          <style type="text/css">

          #whatever { ... }

          </style>

          <!-- InstanceEnd -->

          </head>

           

          It works beautifully.

          • 2. Re: Using Templates for Navigation area
            Ben Pleysier CommunityMVP

            I want to make a class called current to indicate what page the viewer is on,

            You could use javascript to compare the URL with the links and if the same assign a class of current to that link. That will automate the menubar without having to add anything to the individual pages. If this sounds like what you want, please supply a link to your site.

             

            Gramps