Solved

Dreamweaver templates won't update

Posted on 2014-01-20
6
306 Views
Last Modified: 2014-01-23
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
0
Comment
Question by:paulbsb
  • 3
  • 3
6 Comments
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 39796347
Everything between the TemplateBeginEditable and TemplateEndEditable code will not updated.  The tags look like below.
<!-- TemplateBeginEditable name="Body" -->

Open in new window


On your final page, you have a footer library that is not in your template.  Perhaps you dragged that in?
<!-- #BeginLibraryItem "/Library/footer.lbi" -->

Open in new window

That code is inside of an editable region so it will not update.
<!-- #BeginEditable "Body" --> 

Open in new window

The idea of the library is to have one file you can update and it will update all pages so you don't have to do the same thing over and over again for items such as a navigation.

I noticed your page has php inside of the html.  If you feel comfortable, I suggest you ditch the dreamweaver dwt files and use php server side includes http://www.php.net/manual/en/function.include.php

You would create an include file for each of what is your non editable regions like a header, navigation and footer.  You would upload those 3 files to your server and place the include code on your page in dreamweaver.  It is much easier to mange in the end and worth the learning curve.
0
 

Author Closing Comment

by:paulbsb
ID: 39797879
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" -->
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39798294
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.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:paulbsb
ID: 39805363
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.
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39805394
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.  

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

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

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

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


http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_6630-Magic-Quotes-a-bad-idea-from-day-one.html
0
 

Author Comment

by:paulbsb
ID: 39805447
Thanks! I'll check it out.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

It's here again; Microsoft is launching a new version of Internet Explorer: Internet Explorer 9, with noticeable changes on its interface, functions and new tools. As they say on its promotional video: "It's time to play, on a more beautiful web", f…
After uninstalling Opera browser (for example ver. 10.63), your attempts to open a web page by clicking on a URL link may fail with an error message.  The error is "This operation has been canceled due to restrictions in effect on this computer. Ple…
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now