Web Development

Web Development Tips & Tricks, the things that you don’t want to figure out.





Archive for the ‘Dreamweaver

DW8 Bug (IE7!) – FTP Username and Password Lost

Wednesday, July 4th, 2007

I found that many of my friends with new laptops were complaining that their DW8 wasn’t remembering their FTP information for some of their sites. I told them they probably just forgot to click the “remember password” and dismissed the problem.

I found that I only lost the username and password to the last site that was open. If I didn’t get the password and I tried to connect to another site, I lost the username and password to that site as well. It started to really bother me as I had to frequently re-find the passwords to many of my sites. I decided to find a solution.

And so I did! I found that the problem is usually caused by DW8 and IE7 running on the same machine. A weird bug, but a bug nonetheless. An easy solution was to get the Dreamweaver 8.0.2 Updater, which totally solved my problem.

That totally made sense – most all of new laptops come with Windows Vista, which comes with IE7. I had held off before because I knew I needed IE6 for web development and so had never encountered the error. Well, there’s your solution!

If you want the whole Macromedia Support issue on the topic, click here.

Hope that helps.

-Kerry

Dreamweaver Templates Replacement

Tuesday, March 27th, 2007

DW templates are useful for the moment, but can be quite cumbersome to other developers.

They essentially make it so you only have to change the necessary parts of each page, and you can change the template and it will change every page. Well that’s great, but I know from my experience and my web friends that it is very hard to transfer a template to some else.

This means that if you ever stop using the template, or another developer has to use it after you’re done, and they can’t easily grab the template off the web (it can be hard,) that they are scrued and Dreamweaver won’t allow them to change the page. Of course you can do little tricks to each page and eventually regain full control, but that can take some time.

Well, why don’t you just use a find and replace? You should! The only thing is, that there are many different tags that it uses with different attributes. To name a few:

  • <!– InstanceBegin template=”blabla” etc. –>
  • <!– InstanceEnd –>
  • <!– InstanceBeginEditable name=”blabla” –>
  • <!– InstanceEndEditable –>

It may take some time to get through all of this. A friend of mine had this problem today, so I half developed it and asked for some help on a regex forum, and came with up with a great regular expression: “<\!–\s*Instance(Begin|End).*?–>”. When you do a find and replace, you have to do it on closed documents (can’t use current document or open documents). The option I used was “Entire Current Local Site” and replace it with nothing, which removed it all affectively.

You might complain, but it’s so useful! I want that functionality. Well, it’s definitely a good functionality but you should go about it in another way. Use a scripting language like PHP or ASP. Usually you only really need to change the body of the page. This means everything that goes before that point should be included in a filer with a name like “header.php” and you do a simple call like “include(‘header.php’);”, and you do the same thing with the footer.

This will keep the same functionality as with the templates. Now, if you want more editable regions, use variables instead. This varies per scripting language, but I’ll give an example with php. If I wanted a unique title tag, I would put the following code in the header.php file:

<title><?php echo $title; ?></title>

Now, when I called the header file, I could do something like this:

<?php
$title = “Phoenix Development – Home”;
include(“header.php”);
?>

That would automatically put your title in the right place. You just do the same includes on every page and change the variables you use, with the one section you have for the main content. Your page would end up looking something like the code below:

<?php
$title = “Phoenix Development – Home”;
include(“header.php”);
?>
<div id=”text”>
<h1>Home</h1>
<p>Hello and welcome to Phoenix Develo…</p>
</div>
<?php include(“footer.php”); ?>

This is much better code design and the web developer after you will be very glad you had it in this easy style. Also, because you can now universally update all your pages by changing something in the header.php or footer.php, you can change your pages much faster and much more efficiently.

I hope this helps,
Kerry