+ Reply to Thread
Results 1 to 10 of 10

Thread: Help with Dreamweaver templates

  1. #1
    rorybas is offline x10Hosting Member rorybas is an unknown quantity at this point
    Join Date
    Apr 2009
    Posts
    16

    Help with Dreamweaver templates

    I think this is the correct forum but apologies if not. I use Dreamweaver and I make good use of Dreamweaver templates so that changes I make to a template ripple through to all pages based on this template - a great timesaver. However, Dreamweaver seems to have a whole in this functionality and it is code outside of <HTML>. It appears that all code outside is either fixed in the tempate or not. So you can not have code that ripples through and have code specific to a page that is based upon the template. Has anyone found a way around this?
    Thanks

  2. #2
    walidno1 is offline x10 Lieutenant walidno1 is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    Bangladesh
    Posts
    351

    Re: Help with Dreamweaver templates

    sorry, but why would u want a part of the code outside <HTML> tag?? Then its not rendered as html by the browser as far as I know. I use templates in Dreamweaver and if u visit my site, u wud see the only thing wrong with it is that its incomplete!!
    visit my website as a sign of appreciation :D
    Get professional logos designed FOR FREE!!!

    link:http://www.myriad.x10hosting.com

  3. #3
    rorybas is offline x10Hosting Member rorybas is an unknown quantity at this point
    Join Date
    Apr 2009
    Posts
    16

    Re: Help with Dreamweaver templates

    Hi Walidno1. Server scripting code often goes outside the HTML and sometimes must be outside HTML to work. If you have used Dreamweaver server behaviours (dymamic pages, forms, web applications etc) then you will have added code outside of HTML. I have created a template in the past that had some dynamic content. Then the individual pages have had their own dymamic content. Both require code outside of HTML. So when I have changed the dymamic content on the template I have then had to make the same change to all pages based on the template. I hope that explains it. Thanks

  4. #4
    walidno1 is offline x10 Lieutenant walidno1 is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    Bangladesh
    Posts
    351

    Re: Help with Dreamweaver templates

    what kind of server side scripting are u talking abt that needs to go to template??
    visit my website as a sign of appreciation :D
    Get professional logos designed FOR FREE!!!

    link:http://www.myriad.x10hosting.com

  5. #5
    rorybas is offline x10Hosting Member rorybas is an unknown quantity at this point
    Join Date
    Apr 2009
    Posts
    16

    Re: Help with Dreamweaver templates

    In my last example of an events site I had the next event and news items on each page and thus in the template. Each of these extracted the relevant data from a database. This required Dreamweaver recordset server behaviours. I was using PHP/MySQL as my server model.

  6. #6
    nuwanpra's Avatar
    nuwanpra is offline x10Hosting Member nuwanpra is an unknown quantity at this point
    Join Date
    Jan 2010
    Location
    Colombo, Sri Lanka
    Posts
    45

    Re: Help with Dreamweaver templates

    I'm not much clear on your problem. But as far I know Dreamweaver does not write any lines outside of <html> tag. Except the <!DOCTYPE> tag.

    When we are using templates what it does is simply locking all common content of the page. As you specified in .dwt template.

    If you want to add javascripts or css styles which will be common to all pages then you can add those to tamplate(.dwt) file. But better to keep those scripts as separate files and just make a like to those in template file. If you put all your scripts on template you will have to update all other pages (which is referring your template) every time you make changes to scripts.

    Hope this will help...

  7. #7
    rorybas is offline x10Hosting Member rorybas is an unknown quantity at this point
    Join Date
    Apr 2009
    Posts
    16

    Re: Help with Dreamweaver templates

    Thanks nuwanpra. Dreamweaver (I am using CS3 if that helps) does put code outside of HTML (before <!DOCTYPE> even). It does this with PHP server side code when you choose a server behaviour as I stated in previous messages. I know this because I am always curious as to what code it puts in and I look in code view. I fully understand your point about javascript and css and I would, like you put all in a separate file - indeed that is how Dreamweaver does it for client side scripting such as form field validation. It just seems to add loads of code to the actual file for the server side stuff! The only idea I have heard so far is to copy the code into an server side include file so that changes can be made to the include file rather than every page. However, I was hoping someone would have an even neater solution than that - or that I was just not understanding how to do this. I wonder if the later versions of Dreamweaver are cleaner in this respect. Thanks for your comments.

  8. #8
    essellar's Avatar
    essellar is online now Community Advocate essellar has a spectacular aura about
    Join Date
    Feb 2010
    Location
    Toronto, Ontario, CA
    Posts
    1,152

    Re: Help with Dreamweaver templates

    Don't worry about the code outside of the HTML document -- it's not served to the browser; it's processed by the PHP interpreter. (PHP has its own native includes method that works something like SSI, but with a great deal of programmatic control.)

    The DW server behaviours are just a set of callable PHP functions that are essentially the same as the ones used in IIS on a Windows server for ASP(X), and so on -- by keeping the same code generation in Dreamweaver and just changing the server behaviour components for different web servers, the DW client has a lot less work to do.

    It's what's sent to the browser that counts. If that goes bad, then do a View->Source of the web page and post the rogue code here.
    “Beware of bugs in the above code; I have only proved it correct, not tried it.” --Donald Knuth
    "It was as if its architects were given a perfectly good hammer and gleefully replied, 'neat! With this hammer, we can build a tool that can pound in nails.'" -- Alex Papadimoulis (on TheDailyWTF.com)

  9. #9
    walidno1 is offline x10 Lieutenant walidno1 is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    Bangladesh
    Posts
    351

    Re: Help with Dreamweaver templates

    hey, if u have too much problem, here is a thought: until u get the solution, just copy and paste the code for template in those pages and use the code there (without using the template in those pages)
    visit my website as a sign of appreciation :D
    Get professional logos designed FOR FREE!!!

    link:http://www.myriad.x10hosting.com

  10. #10
    rorybas is offline x10Hosting Member rorybas is an unknown quantity at this point
    Join Date
    Apr 2009
    Posts
    16

    Re: Help with Dreamweaver templates

    Thanks for the responses.
    walidno1. I think copy and pasting to a PHP include file is the simplest option given that DW does not manage this well. I think that is simpler than copy and pasting the changes to every page based upon the template.
    essellar. I understand that the code outside of the HTML is processed by the PHP interpreter rather than the browser. I also understand that PHP has its own includes method. Finally, I understand that DW server behaviour are calls to external functions. However, the issue is copying this code to many different pages based upon a template. This is why I will opt for include files.
    Thanks

+ Reply to Thread

Similar Threads

  1. Replies: 3
    Last Post: 12-04-2009, 10:50 PM
  2. need dreamweaver help plz
    By Lord_Ammar in forum Free Hosting
    Replies: 1
    Last Post: 08-23-2008, 01:33 PM
  3. Dreamweaver
    By brittain in forum Scripts & 3rd Party Apps
    Replies: 2
    Last Post: 12-08-2007, 07:41 AM
  4. more dreamweaver
    By NeonWarrior in forum Scripts & 3rd Party Apps
    Replies: 3
    Last Post: 09-10-2007, 09:21 AM
  5. FTP con Dreamweaver
    By Sharenow in forum Soporte
    Replies: 5
    Last Post: 07-29-2007, 12:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers