2 Replies Latest reply on Apr 25, 2010 10:36 AM by hans-g.

    Dreamweaver Teamplate with Library Item for Navigation/Sidebar not updating editable classes

    Scataloth Level 1

      I have a Dreamweaver Template that contains two Library items. One Library item is my navigation bar, the other is a sidebar that shows different content depending on what page you are on. I'm assigning an editable class "active" to the navigation bar to show you are on a particular page, and also assigning the editable class "active" to the sidebar to reveal a portion of the sidebar with links pertaining to that specific page. The default value for the class is "hidden". So what is happening is when I open a page I have created and "edit" the Library Items in it to edit these classes, it resets resets all the other pages on the site to the default class values. How am I able to use editable classes and Library Items to achieve this kind of functionality? The idea is to only have ONE navigaton bar to update on the site and to only have ONE sidebar item to update. Here is an example of the sidebar and navigation in action so you can see what I'm going for. Notice the green button in the navigation bar (that is a list item with the class "active" which is an editable class in the Library Item, also notice the tan links in the sidebar, that is an unordered list that has an editable class of "active" in the Library Items --- these editable classes reset to their defaults when updating the Library Item on the website).

       

      http://www.brumleve.org/joe/temp/CAP/mission.html

        • 1. Re: Dreamweaver Teamplate with Library Item for Navigation/Sidebar not updating editable classes
          hans-g. Adobe Community Professional & MVP

          Hi,

           

          your question "smells" for "using server-side includes". In these threads David_Powers gave me a wonderful hint:

           

          http://forums.adobe.com/message/2538973#2538973

          And after that (I quote David_Powers from http://forums.adobe.com/thread/561892): Several people have asked about this in the past, so I decided to create a quick tutorial. It's at http://foundationphp.com/tutorials/sprymenu/ssi.php.

           

          Hans-G.

          • 2. Re: Dreamweaver Teamplate with Library Item for Navigation/Sidebar not updating editable classes
            CVK-USA Level 1

            In my understanding, whenever you edit the contents of a library item, it will update all other occurances of this library item on the rest of the site. That's "working as designed" as far as I know, unless you break the link by telling it to not update - which kinda defeats the purpose I think.

             

            But theres another way to do this using template properties, i#ve been using this approach myself a couple of times:

             

            Write your navigation bar in the template (.dwt) file itself, then select the class= of your first menu item and choose .. (names might be off, I am using a non-English copy of DW): "modify > template > make attribute editable" from the main menu. Do so for all your menu items and name these new template properties something like "item_x_class"

             

            You'll end up with something like this in your template source:

             

            <div class="@@(item_1_class)@@">

             

            and a matching

             

            <!-- TemplateParam name="item_1_class" type="text" value="active" --> in the header

             

             

             

            Now, on each page, you can set the class within the template properties dialog ("modify > template properties"). If your main menu changes, it won't overwrite your template properties, but still update all pages when you do make a change to the menu.

             

            If you're using multiple templates for your site, consider nesting templates, so the master template already includes your navbar and all subsequent templates will "inherit" changes to the navbar code (sans the editable class property).

             

             

            Hope this helps.. or at least gives you an idea for further experiments..

             

            Stephan