Link to home
Start Free TrialLog in
Avatar of paulbsb
paulbsb

asked on

Dreamweaver templates won't update

I have an old,  big site based on Dreamweaver templates that I'm trying to update. I've built a new template but when I update the pages it won't update the html. It also keeps the same bottom table with the navigation of the various galleries and the Web Classics Plus logo but updates the galleries at the bottom. The templates are attached saved as .htm files and the css is below. Can anyone help? Thanks...Paul

Original template:
http://www.paulb.com/Classics_.htm
New template:
http://www.paulb.com/Classics.htm
Page based on new template:
http://www.paulb.com/twilite5.htm
This is the  css pics stylesheet thet's attached. The others are fonts.  :
/* CSS Document */
body {
background-color: #000;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
body,td,th {
color: #FFF;
}
.clear {
clear: both;
padding-bottom: 0px;
}
.footer {
text-align: center;
margin-top: 10px;
margin-bottom: 2px;
}
.header {
background-color: #004100;
padding-left: 40px;
height: 115px;
padding-top: 15px;
padding-bottom: 15px; /*padding-top: 0px;*/
}
.bottom {
font-family: SansationRegular;
color: #FFF;
background-color: #004100;
clear: both;
border-top-width: 15px;
border-top-style: solid;
border-top-color: #33cc00;
font-size: 9px;
padding-top: 10px;
padding-right: 10px;
padding-bottom: 0px;
padding-left: 10px;
font-weight: lighter;
}
#footer {
font-family: AndikaBasicRegular;
font-size: 10px;
color: #333;
background-color: #33cc00;
padding: 5px;
margin-right: auto;
margin-left: auto;
}
.gallery {
font-family: AndikaBasicRegular;
font-size: 16px;
text-align: center;
padding-top: 20px;
}
h1 {
font-family: AndikaBasicRegular;
font-size: 24px;
text-align: center;
padding-top: 10px;
padding-bottom: 5px;
font-weight: lighter;
}
.menu {
background-color: #01cc00;
padding-right: 25px;
padding-left: 30px;
padding-top: 15px;
padding-bottom: 15px;
text-align: left;
font-size: 24px;
}
.menu ul li a:hover, a:active, a:focus {
color: #FFF;
}
.menu ul li a:link, a:visited {
font-weight: normal;
color: #000;
text-decoration: none;
font-family: SansationRegular;
/*font-size: 1.em;*/
font-size: 0.7em;
}
.menu ul {
margin: 0px;
padding: 0px;
}
.menu ul li {
list-style-type: none;
display: inline;
margin-right: 20px;
}
.center  {
font-family: AndikaBasicRegular;
font-size: 14px;
color: #FFF;
background-color: #000;
float: none;
padding-top: 60px;
padding-left: 40px;
}
.content .top {
float: left;
width: 620px;
font-family: AndikaBasicRegular;
font-size: 16px;
}
.content .top p a:link {
color: #33cc00;
text-decoration: none;
}
.content .top p a:visited {
color: #33cc00;
text-decoration: none;
}
h2 {
font-family: AndikaBasicRegular;
font-size: 14px;
font-weight: lighter;
text-align: left;
padding-right: 300px;
padding-left: 300px;
}
h3 {
font-size: 18px;
font-weight: lighter;
}
.gallery p {
font-size: 12px;
float: left;
padding-left: 300px;
text-align: left;
}
.bottom h2 {
font-family: SansationRegular;
font-size: 14px;
color: #FFF;
font-weight: bold;
font-variant: small-caps;
margin-top: -10px;
margin-bottom: -10px;
padding-top: 10px;
text-align: center;
}
.gallery .year .size {
text-align: left;
display: inline;
padding-left: 200px;
font-size: 12px;
}
.bottom h3 a {
font-family:SansationRegular;
font-size: 11px;
color: #FFF;
text-decoration: none;
margin-bottom: -30px;
padding-bottom: -50px;
font-weight: lighter;
}.gallery .year {
font-size: 12px;
}
twilite5.htm
Classics.htm
Classics-.htm
ASKER CERTIFIED SOLUTION
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of paulbsb
paulbsb

ASKER

This is one of the things I'm trying to lose.  It was in the original template, I took it out of the new one, but DW keeps inserting it on it's own. Any suggestions?

>>>>>>On your final page, you have a footer library that is not in your template.  Perhaps you dragged that in?
<!-- #BeginLibraryItem "/Library/footer.lbi" -->
I admit when I first started using dreamweaver, I used their template dwt files and other bells and whistles because I figured I paid a lot for the software and want to use everything it has.  At some point I realized there are things I like about it and some things I didn't and stopped using such as their own dwt template files.   If you want to make a change to a non editable area, you have to essentially do a large find and replace (automated by dreamweaver) but if you have something out of place, your site gets messed up.

Instead use server side includes http://www.php.net/manual/en/function.require.php or http://www.w3schools.com/php/php_includes.asp

Assume a page  http://jsbin.com/padasQ_28343650/1/edit?html,js,output
<!DOCTYPE html>
<html>
<head>
  <!-- css scripts -->
  <link href="/mycss.files.css" rel="stylesheet" type="text/css" />
  <!-- javascripts -->
  <script src="/js/myjs.files.js"></script>
  <!-- place metta data -->
  <meta name="description" content="blah blah blah" />
<meta charset=utf-8 />
<title>My Title</title>
</head>
<body>
  <!-- heading/logo -->
  <div id="heading">My company name</div>
  <!-- main body -->
  <div id="main">All about me</div>
  <!-- footer -->
  <div id="footer">I am the base of every page</div>
</body>
</html>

Open in new window


Convert to php http://jsbin.com/padasQ_28343650/2/edit?html and use includes/require
<!DOCTYPE html>
<html>
<head>
  <!-- css scripts -->
  <?php
require '/includes/css.php';
  ?>
  <!-- javascripts -->
   <?php
require '/includes/js.php';
  ?>
  <!-- custom css for the page -->
  <style>
    .someStyle{color:red;}
  </style>
  <!-- place metta data -->
  <meta name="description" content="blah blah blah" />
<meta charset=utf-8 />
<title>My Title</title>
</head>
<body>
  <!-- heading/logo -->
 <?php
require '/incudes/header.php';
  ?>
  <!-- main body -->
  <div id="main">All about me</div>
  <!-- footer -->
  <?php
require '/includes/footer.php';
  ?>
</body>
</html>

Open in new window

Where you see the php code to use the "require" code it will bring in a page on your site in it's place.  In this case, I used the folder "includes".   Starting with your  css.php page It would not have any code except
  <link href="/css/mycss_file.css" rel="stylesheet" type="text/css" />
  <link href="/css/mycss_file_2.css" rel="stylesheet" type="text/css" />

Open in new window

Then the js.php would only have
<script src="/js/myjs.files.js"></script>
<script src="/js/myjs.some_other_file.js"></script>

Open in new window

Your header.php may look like
<div id="header">
         <div id="logo"><img src="mylogo.jpg"></div>
         <div id="nav">
               <ul><li>some link</li><li>some link</li><li>some link</li></ul>
         </div>
</div>

Open in new window

and same for the footer or any other part you want to use on every page.   Notice the only code is what would normally be in the place if it is a plain html file.

Now, lets's say you have 20 pages on your website and you want to add to the navigation.  In the current dreamweaver dwt file, you would need to udpate the dwt file, then do an update (find and replace) then upload the entire site.

Using the new method, you would simply update the one header.php file and upload just the one file.  

The main problems I see people ask about with dreamweaver has to do with templates and "site" set ups and this will take that away.  When you are using this type of code in dreamweaver, obviously  you need to type the include code in your code view which is a good practice.  But in your design view, you can edit directly if that is what you are used to doing.  Actually, you can only edit the page you are on, the other "includes" will be visible in design view, but you can't edit them just like your dwt file.
Avatar of paulbsb

ASKER

I saw this response late yesterday and just digested it.

I started my site with php/MySQL. It's not even live yet and it's already been hacked.
http://www.paulb.com/1-newsite/gallery.php
On this page click  "Next" and the hack is the one that is not a picture. I've also had two other sites hacked recently. Once I upload to these pages they don't change, except to nav and things like that. I'm very concerned with security, and I think html pages are more secure. Any thoughts?
Thanks.
You probably did not scrub your data before allowing input to your db.  On the page you did link to, you have your sql command in the code.  Take that out.  When you have a querystring like gallery.php?curPage=1 it means you are accessing your database.  If you are using something like $_GET and taking it directly from the querystring to the db you are in trouble.  

I am not a real php guy, I would suggest you post a new question in the php zone on the proper way to get a querystring and use that to display data from your db.  The articles from EE are a good read and to help you understand.  

https://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_12293-AntiPHPatterns-and-AntiPHPractices.html

https://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_11177-PHP-MySQL-Deprecated-as-of-PHP-5-5-0.html

https://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_12241-Quotation-Marks-in-PHP.html

https://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/PHP_Databases/A_686-PHP-Prevent-SQL-Injection.html


https://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_6630-Magic-Quotes-a-bad-idea-from-day-one.html
Avatar of paulbsb

ASKER

Thanks! I'll check it out.