Wrox Programmer Forums
|
BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4
This is the forum to discuss the Wrox book Beginning Dreamweaver MX by Charles E. Brown, Imar Spaanjaars, Todd Marks; ISBN: 9780764544040
Please indicate which version of the book you are using when posting questions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 7th, 2005, 02:32 PM
Authorized User
 
Join Date: Apr 2005
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dreamweaver Altering Code Why?

Hi

I tagged this onto a previous post where I needed help getting links to work.

Please tell me why Dreamweaver alters the code so that images or files in sub directories will not work. I made an alteration to a library item (added an new link) now all the links in the templates do not work.

I have to go through the templates and add the ..

If anyone does not understand my ptoblem and think they have the same please let me know and I can explain how to ger round it.

Is this a design error? If so could the propper authorites pass it on or am I doing something wrong.

Jacky Kenna

 
Old August 7th, 2005, 03:21 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I am not sure I understand the problems you're having. That is, when I update a Library item, my templates and the pages based on it get updated correctly.

Are you maybe misunderstanding how this feature is supposed to work?

For example, when you have this in a Library item:

<a href="../SomePage.asp">

you get the same link in the Template as well. That's because both the Library and the Templates folder are located in the root. So, one folder up (..) from Library to the root is the same as one folder up from the Templates folder.

However, if you now base a page on the template located in root of the site, you get this:

<a href="SomePage.asp">

and if you save the template child two folders deep, you get this:

<a href="../../SomePage.asp">

This is not an error; this is desired behavior. DW sees that the template child and SomePage both live in the same folder, so it removes the .. in the first example. It adds the .. twice for the file located two folders deep to end up in the root.

Isn't this what you're seeing?

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old August 8th, 2005, 05:26 AM
Authorized User
 
Join Date: Apr 2005
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar

I am not sure why this should be so hard for Dreamweaver. I will show examples from the code.

I create a file in the root. Please see the code created by DW for one image
<img src="/./Images/Shelterbox/Aircraft.jpg" width="206" height="257" border="5" align="left">
This is visible in DW but not in browser
I remove the first /
Now it is visible in browser
I now want to embrace this in a template. ( I check all that links work in the template --They do)
I drag the template on to the file and reconcile body to contents.
Test the links again. All is still OK. (the file is still in the root.
I now save the working file to the location I require. A directory called Screens.
File/Save as/(browse to Screens)enter the file name.
DW asks if I want to up date links. Yes I do. OK
The screen then tell me that the file has been modified outside DW do I want to re load it Yes. (This really confuses me as I have been in DW all the time.)
Now I have the new file visible in DW.
Test it in my browser and none of the links work.
No template no Navigation No Images
Check the example above
<img src="/./Images/Shelterbox/Aircraft.jpg" width="206" height="257" border="5" align="left">
As you can see DW has reproduced the code as it was in the first instance which does not work. This is the same for the library items which form the Menu and the other images.
If I enter .. the image is still visible in DW but not in my browser.

I do not understand what is going on. If I knew this I might be able to figure it out. I now have the option of leaving my new file in the root. At least it works there but this will not help me if I ever have large numbers of files. Also I will have to re do the link which requires I alter and test the other templates which use this library.

What I genuinely can't understand is. DW asks "do you want to up date" and I say yes why does it not do so or can it not understand the directory movement?

What I have done is take another screen, dump in the new text and images and alter the .. to make it work. This does not give me the advantages of templates and libraries and makes me feel that I am playing a balancing act rather than a solid system which is not about to topple.


As I said in an earlier post. I will be taking courses in the Autumn which will help me get these issue sorted.

All the best

Jacky






 
Old August 8th, 2005, 02:34 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

This image doesn't look right:

<img src="/./Images/Shelterbox/Aircraft.jpg" width="206" height="257" border="5" align="left">

It should NOT start with the / and the dot. How does the image get there? And how did you configure the Site panel? That is, what did you fill in for local, testing and remote servers? Dreamweaver shouldn't be inserting these kind of links, so it's either a configuration error, or a bug.

Which DM version are you using BTW??

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with a book "joy of dreamweaver code" busteronline ASP.NET 2.0 Basics 0 September 11th, 2008 11:50 AM
Altering a listbox from another form Firestorm9 C# 2005 1 July 9th, 2007 06:12 AM
Altering the Identity seed value g_vamsi_krish SQL Language 2 July 7th, 2006 12:58 AM
Altering Shopping Cart Code for Paypal flashcash5 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 2 April 19th, 2005 09:58 PM
Can I write ASP code in Dreamweaver? Ben Horne Dreamweaver (all versions) 13 December 4th, 2003 04:00 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.