2 Replies Latest reply on May 23, 2010 8:48 PM by Codefinger

    Can I create template-based library objects in Dreamweaver CS5?

    Codefinger Level 1

      At work we need two 'streams' of template. The first are general layout templates, like the ones already available in the MX through CS5 packages (except we'd have our own customised ones). The second are more granular objects, some of which are functional.


      In both cases, I don't want Jimmy to be able to wreak havoc inside anything other than the 'editable regions' which make up the templates.

      Now this is fine if I stick with the first scenario (layout templates) where there's simply a big chunk of editable region for good ole Jim to sprawl into, think of this as the 'body content' area. But I really do need these granular library (or snippet) objects to work in the same way. Unfortunately with my attempts so far they don't work as I'd have thought - perhaps for good reason?


      When I create a blank template and throw in my chunk of HTML (unobstrusive JS and external CSS use selectors in this HTML to provide style and function) and save it as a new library item or snippet, all looks well. Then I create a new document based on a layout template and save it as a plain html file (still all good so far). Next I drop in my custom library item... still all good... but then I go to save the document and it only allows me to save it as a new template! I expected it would just allow me to save it as HTML and have it simply respect the defined editable regions, as happens in the containing page 'body content' editable region.


      Apologies if that got specific and technical quite quickly, but it is quite particular. If you want some example files lemme know and I'll zip some up.

      Many thanks


      p.s It is not a requirement that my library objects must somehow inject their dependency files into the newly created page - I already know what they'll be. Also, I know I must 'detatch from original' once I drop a library item into a document which then allows customisation of the library object.

        • 1. Re: Can I create template-based library objects in Dreamweaver CS5?
          jxlusa Level 2

          Sorry I don['t have to really look into this, but offhand, I wonder if you could achive the effect you are looking for in a regular template using Optional Regions.

          If you make an Editable Optional Region in a template, you can move the editable part around within it, and put any code you want to outside the editable part, leaving your snippets un-editable, but leaving a place that Jimmy can add his own content.

          • 2. Re: Can I create template-based library objects in Dreamweaver CS5?
            Codefinger Level 1

            Unfortunately that leads me to the same place, I suppose another way of saying my question which may clear the matter up, is: "Can I embed mutually exclusive templates inside templates?"


            For those of you who like things explained conceptually in XML structures, or you're an Adobe developer and you think this isn't currently possible but is awesome, the basic premise is this:


            <page template>

                 <noneditable region />

                 <editable region>

                      Jimmy's text blah blah lorem ipsum.

                      <widget template>

                           <editable region>

                                Jimmy's widget customised title

                           </editable region>

                           <noneditable region />

                           <editable region>

                                Jimmy's widget customised feedback

                           </editable region>

                      </widget template>

                 </editable region>

                 <noneditable region />

            </page template>


            Where '<page template />' is stored as a Template (a layout template), and '<widget template>' is stored in either the Library, or as a Snippet.