Converting templates to include SSI

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

  1. #1

    Default Converting templates to include SSI

    I manage a site using Dreamweaver 7.0 (win). I created a template file that is
    used for most of the pages on the site. I would like now to replace the header
    and footer tables that appear on every page with SSI so when something on
    those change I don't have to upload every file on the site. (You can see the
    site I am working on at [url]http://www.svunet.org[/url]. and the new template file I am
    creating at [url]http://www.svunet.org/newtemplate.shtml[/url]

    What is the best way of doing this? It seems that the template is no longer
    serves a purpose so I suppose that I should just open every page, copy the
    table that is specific to the page and paste it into a new .SHTML file that
    includes the SSIs. Even if I keep the existing template, replace the existing
    headers and footers with SSI, and apply it to every page I will still have to
    go to every file and change the extension from .htm to .shtml. Am I missing an
    easier way to do this? Any advice will be appreciated. Thank you.


    TSemmes Guest

  2. Similar Questions and Discussions

    1. Templates vs. Include files
      I build websites using dynamic web templates and it really works for me. Now, I have a client asking why we should do that over using include files?...
    2. Libraries, Templates, Nested Templates, Repeat Regions,
      Hi I have eight categories to display in my site navigation. Each category has at least one (some have two) levels of subcategories. For example...
    3. Templates with include files
      Hey guys!!! I have a question. I know it's not that much related to this forum but I am having a bit of a problem. I created 3 files that I am...
    4. Strange Include problems: Repeat regions will Not workwith include file
      I have a strange problem. I have an Index.asp page and on that page I have a poll that is displays. This poll is located in a sub folder, so to call...
    5. #26259 [Opn->Bgs]: relative include path not working with include() from shell command line execut
      ID: 26259 Updated by: iliaa@php.net Reported By: orsaini at allainet dot com -Status: Open +Status: ...
  3. #2

    Default Re: Converting templates to include SSI

    Create the includes. Replace the content with the includes in the Template
    page. Let this update all your pages. Upload them all, along with the
    included files.

    --
    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
    ==================


    "TSemmes" <webforumsuser@macromedia.com> wrote in message
    news:dvuovc$jbk$1@forums.macromedia.com...
    >I manage a site using Dreamweaver 7.0 (win). I created a template file that
    >is
    > used for most of the pages on the site. I would like now to replace the
    > header
    > and footer tables that appear on every page with SSI so when something
    > on
    > those change I don't have to upload every file on the site. (You can see
    > the
    > site I am working on at [url]http://www.svunet.org[/url]. and the new template file I
    > am
    > creating at [url]http://www.svunet.org/newtemplate.shtml[/url]
    >
    > What is the best way of doing this? It seems that the template is no
    > longer
    > serves a purpose so I suppose that I should just open every page, copy the
    > table that is specific to the page and paste it into a new .SHTML file
    > that
    > includes the SSIs. Even if I keep the existing template, replace the
    > existing
    > headers and footers with SSI, and apply it to every page I will still have
    > to
    > go to every file and change the extension from .htm to .shtml. Am I
    > missing an
    > easier way to do this? Any advice will be appreciated. Thank you.
    >
    >

    Murray *ACE* Guest

  4. #3

    Default Re: Converting templates to include SSI

    Murray
    I tried what doing what you said and it isn't working. Can SSI work with
    Dreamweaver templates? It seems not becasue I am though I can view SSI in a
    non-template file: [url]http://www.svunet.org/newtemplate.shtml[/url]

    I can't view it in a template-generated file:
    [url]http://www.svunet.org/about/bylaws.html[/url]. Even when I change the extension to
    ..shtml [url]http://www.svunet.org/about/bylaws.shtml[/url] though having to do so would
    defeat some of the purpose of having a template since I would have to manually
    have to edit the extension on each file. Is what I am trying to do impossible
    or am I doing something wrong?

    Tom

    TSemmes Guest

  5. #4

    Default Re: Converting templates to include SSI

    > Murray
    > I tried what doing what you said and it isn't working. Can SSI work with
    > Dreamweaver templates?
    If it doesn't then I am definitely drinking too much. Sure it does.
    > I can't view it in a template-generated file:
    > [url]http://www.svunet.org/about/bylaws.html[/url].
    The file has to have an extension that triggers a server parse. Otherwise
    the server will never know that it has an include directive in there.
    > since I would have to manually
    > have to edit the extension on each file.
    Huh?

    What is the name of your Template, please?

    And show me the include line's code that is in
    [url]http://www.svunet.org/about/bylaws.shtml[/url] please.

    --
    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
    ==================


    "TSemmes" <webforumsuser@macromedia.com> wrote in message
    news:e018am$pn$1@forums.macromedia.com...
    > Murray
    > I tried what doing what you said and it isn't working. Can SSI work with
    > Dreamweaver templates? It seems not becasue I am though I can view SSI
    > in a
    > non-template file: [url]http://www.svunet.org/newtemplate.shtml[/url]
    >
    > I can't view it in a template-generated file:
    > [url]http://www.svunet.org/about/bylaws.html[/url]. Even when I change the extension
    > to
    > .shtml [url]http://www.svunet.org/about/bylaws.shtml[/url] though having to do so
    > would
    > defeat some of the purpose of having a template since I would have to
    > manually
    > have to edit the extension on each file. Is what I am trying to do
    > impossible
    > or am I doing something wrong?
    >
    > Tom
    >

    Murray *ACE* Guest

  6. #5

    Default Re: Converting templates to include SSI

    This is the template: [url]http://www.svunet.org/Templates/generic.dwt[/url]

    This is the code from the bylaws.shtml up to the first include:

    <html><!-- #BeginTemplate "/Templates/generic.dwt" --><!-- DW6 -->
    <head>
    <!-- #BeginEditable "doctitle" -->
    <title>About SVU: Bylaws</title>
    <!-- #EndEditable -->
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link href="../svustyle-new.css" rel="stylesheet" type="text/css">
    </head>
    <body
    onResize="P7_Snap('link1','closer',0,0,'link1','Ev ents',0,0);P7_ReDoIt()">
    <!--#include file="../navbar.ssi" -->

    and this is the last few lines of code that includeds the footer SSI:

    <!--#include file="../footer.ssi" -->
    </body>
    <!-- #EndTemplate --></htm
    l>

    What I meant about "manually having to edit the extension on each file" was
    that to make this work I will have to rename every file in the site from *.htm
    to *.shtml to make the SSI work. ISn't that correct?

    Tom

    TSemmes Guest

  7. #6

    Default Re: Converting templates to include SSI

    > ISn't that correct?

    Yes. The alternative would be for you to ask your host to enable server
    parsing for all file extensions. Some will and some won't. Those who won't
    aren't worth continuing to support.

    Also, if you have this link in your template file -

    <body
    onResize="P7_Snap('link1','closer',0,0,'link1','Ev ents',0,0);P7_ReDoIt()">
    <!--#include file="../navbar.ssi" -->

    then you really cannot have that same link in your child page -
    > <body
    > onResize="P7_Snap('link1','closer',0,0,'link1','Ev ents',0,0);P7_ReDoIt()">
    > <!--#include file="../navbar.ssi" -->
    Since DW would manage that link. You could try changing those links to
    virtual ones -

    <body
    onResize="P7_Snap('link1','closer',0,0,'link1','Ev ents',0,0);P7_ReDoIt()">
    <!--#include virtual="/navbar.ssi" -->

    in which case, they would not need to be managed.

    Finally, you have a huge chunk of javascript in your navbar.ssi file.
    That's not best practice. The javascript needs to be in the file doing the
    include, not in the include file.

    --
    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
    ==================


    "TSemmes" <webforumsuser@macromedia.com> wrote in message
    news:e01epg$9hi$1@forums.macromedia.com...
    > This is the template: [url]http://www.svunet.org/Templates/generic.dwt[/url]
    >
    > This is the code from the bylaws.shtml up to the first include:
    >
    > <html><!-- #BeginTemplate "/Templates/generic.dwt" --><!-- DW6 -->
    > <head>
    > <!-- #BeginEditable "doctitle" -->
    > <title>About SVU: Bylaws</title>
    > <!-- #EndEditable -->
    > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    > <link href="../svustyle-new.css" rel="stylesheet" type="text/css">
    > </head>
    > <body
    > onResize="P7_Snap('link1','closer',0,0,'link1','Ev ents',0,0);P7_ReDoIt()">
    > <!--#include file="../navbar.ssi" -->
    >
    > and this is the last few lines of code that includeds the footer SSI:
    >
    > <!--#include file="../footer.ssi" -->
    > </body>
    > <!-- #EndTemplate --></htm
    > l>
    >
    > What I meant about "manually having to edit the extension on each file"
    > was
    > that to make this work I will have to rename every file in the site from
    > *.htm
    > to *.shtml to make the SSI work. ISn't that correct?
    >
    > Tom
    >

    Murray *ACE* Guest

  8. #7

    Default Re: Converting templates to include SSI

    Thank you Murray! The suggestion about using a virtual link worked!
    I haven't tried yet moving the javascript from the SSI file to the template
    file. I thought that since the javascript made the links on the navigation bar
    work they should be in the SSI file with it. The drop downs seem to work but i
    could try it with the javascript in the template file.
    I didn't understand your comment about the link in the template file also
    being in the child file. Isn"t that the way it is supposed to work with the
    coding from the template file copying to the child file? maybe i don"t
    understnad what you mean by child file. Anyway it seems to work. Much
    appreciated!

    TSemmes Guest

  9. #8

    Default Re: Converting templates to include SSI

    Since template files are in the Templates folder, every link in them should
    be like this -

    <img src="../images/whatever

    or this -

    <img src="/images/whatever

    or this -

    <img src="http://www.example.com/images/whatever

    If they are like the former, then they will be managed by DW - in other
    words, when you spawn a child from the template, and save it in the ROOT of
    the site, that same link will be manged to reflect the location, i.e.,

    <img src="images/whatever

    See what I mean?

    --
    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
    ==================


    "TSemmes" <webforumsuser@macromedia.com> wrote in message
    news:e01n7i$k9m$1@forums.macromedia.com...
    > Thank you Murray! The suggestion about using a virtual link worked!
    > I haven't tried yet moving the javascript from the SSI file to the
    > template
    > file. I thought that since the javascript made the links on the navigation
    > bar
    > work they should be in the SSI file with it. The drop downs seem to work
    > but i
    > could try it with the javascript in the template file.
    > I didn't understand your comment about the link in the template file also
    > being in the child file. Isn"t that the way it is supposed to work with
    > the
    > coding from the template file copying to the child file? maybe i don"t
    > understnad what you mean by child file. Anyway it seems to work. Much
    > appreciated!
    >

    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