PHP Code above DW Template doctype?

Ask a Question related to Macromedia Dynamic HTML, Design and Development.

  1. #1

    Default PHP Code above DW Template doctype?

    I've built a website in a DW Template; the pages are .php. We added a PHP
    script, a bit of code that needs to be at the top of the pages (before the
    doctype, or anything else, for that matter), which works fine in the Template
    -- except for the couple of pages that need slightly different script at the
    top; when we update the Template it rewrites the page-top script in those two
    pages.

    I'd thought of adding an editable region above the <head>, but I'm not sure
    how DW might treat an editable region above the <head> and it would mean
    comment tags as the first item on the page rather than the PHP script.

    Of course, I can manually edit the couple of pages (or detach them from the
    Template), but I'd far prefer to allow DW to update the Template without
    touching this code. Is there some way around this, so that the DW Template
    ignores the code above, say, the doctype?

    Thanks in advance.

    DianeV Guest

  2. Similar Questions and Discussions

    1. capture code generated from template
      is there any way to capture the output generated by a template into a variable?
    2. Contribute changes template code when editing
      i have a javascript in my template which is in a locked area. when i edit a page in contribute, it removes the line breaks in the script and breaks...
    3. How to add or modify template columns via-code
      Hi, I know how to add template columns via the designer or the HTML source Now, I want to add a template column (<ItemTemplate> and...
    4. code block in template control
      I have created a templated control. I used for a while and the I decided to put some internatioanlized string instead of hardcoded string into the...
    5. Fitting the asp code in a page inside the asp code in a template
      I'm adding code in a template which connects to the only database and also closes the connection. Every page in the site uses the template and...
  3. #2

    Default Re: PHP Code above DW Template doctype?

    > when we update the Template it rewrites the page-top script in those two
    > pages.
    This is not the default behavior of templates. By default the regions above
    <html> and below </html> are treated as editable regions. Changes that you
    make to the template will never propagate that code, hence will never
    overwrite that region. The overwriting can ONLY occur if you change from
    the default treatment to an optional treatment of those regions by including
    the line -

    <!-- TemplateInfo codeOutsideHTMLIsLocked="true" -->

    in the head region of the template page. This tells DW to consider the
    region outside of <html> as if it were non-editable, and therefore changes
    there WILL propagate. In addition, because this region is now non-editable,
    when a child page with unique content in that region is updated by the
    template, that unique content will be erased.

    Did you do this?
    > I'd thought of adding an editable region above the <head>, but I'm not
    > sure
    > how DW might treat an editable region above the <head> and it would mean
    > comment tags as the first item on the page rather than the PHP script.
    You cannot do that.

    --
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    [url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
    [url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
    ==================


    "DianeV" <webforumsuser@macromedia.com> wrote in message
    news:e9l91u$ion$1@forums.macromedia.com...
    > I've built a website in a DW Template; the pages are .php. We added a PHP
    > script, a bit of code that needs to be at the top of the pages (before the
    > doctype, or anything else, for that matter), which works fine in the
    > Template
    > -- except for the couple of pages that need slightly different script at
    > the
    > top; when we update the Template it rewrites the page-top script in those
    > two
    > pages.
    >
    > I'd thought of adding an editable region above the <head>, but I'm not
    > sure
    > how DW might treat an editable region above the <head> and it would mean
    > comment tags as the first item on the page rather than the PHP script.
    >
    > Of course, I can manually edit the couple of pages (or detach them from
    > the
    > Template), but I'd far prefer to allow DW to update the Template without
    > touching this code. Is there some way around this, so that the DW
    > Template
    > ignores the code above, say, the doctype?
    >
    > Thanks in advance.
    >

    Murray *ACE* Guest

  4. #3

    Default Re: PHP Code above DW Template doctype?

    Thanks, Murray. I was hoping you'd show up. :)

    <!-- TemplateInfo codeOutsideHTMLIsLocked="true" -->

    Yes, that's what it says. Thanks for explaining.

    If I can find a (correct) way to switch it to false, I'll just have to
    manually add the php coding to the top, but that would be preferable to
    hand-editing the two pages every time we do a template update.

    DianeV Guest

  5. #4

    Default Re: PHP Code above DW Template doctype?

    Ah, I was able to do it simply by editing that comment in the Template. How easy was that?!!

    You da man, Murray. :)
    DianeV Guest

  6. #5

    Default Re: PHP Code above DW Template doctype?

    Actually, just remove that line altogether from the template page. That
    will give you the default behavior, which is FALSE.

    --
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    [url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
    [url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
    ==================


    "DianeV" <webforumsuser@macromedia.com> wrote in message
    news:e9levm$q5f$1@forums.macromedia.com...
    > Ah, I was able to do it simply by editing that comment in the Template.
    > How easy was that?!!
    >
    > You da man, Murray. :)

    Murray *ACE* Guest

  7. #6

    Default Re: PHP Code above DW Template doctype?

    Excellent. Thanks.
    DianeV Guest

  8. #7

    Default Re: PHP Code above DW Template doctype?

    You're welcome....

    --
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    [url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
    [url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
    ==================


    "DianeV" <webforumsuser@macromedia.com> wrote in message
    news:e9marr$2t7$1@forums.macromedia.com...
    > Excellent. Thanks.

    Murray *ACE* Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139