PDA

View Full Version : Duplicate Attribute...


JALDesign
05-16-2011, 11:58 AM
After I created a template in DW and tested it in a browser all looked OK. But, when I try to create a new page from it I get the duplicate attribute problem. And, it doesn't let me edit the code. There are two places it does this:

<link href="file:///Macintosh HD/Users/john/Documents/Johns Business/Clients/Jake Co.'s/Red Boards Media /Web Site/DWweb site/thrColFixHdr.css" rel="stylesheet" type="text/css" />

and,

<img src="file:///Macintosh HD/Users/john/Documents/Johns Business/Clients/Jake Co.'s/Red Boards Media /Web Site/DWweb site/Images/logo_header.gif" width="267" height="65" alt="redBOARDS logo" />

Since I labored over the template so the rest of the development would go smoothly, I now find myself facing a tight deadline and dead in the water. Help!

johnMoss
05-16-2011, 12:55 PM
One immediate resolution is to edit your code outside of dreamweaver. Open up notepad, edit your code in there, where you can do as you please....

JALDesign
05-16-2011, 12:58 PM
Thank you. That is helpful. But, since DW wrote the code I am not sure what the duplicate attribute is. Do you have any idea?

johnMoss
05-16-2011, 01:12 PM
In closing your tags, try >, instead of />, which you currently have. I can't see what html you have declared, but apparently the validator is picking on you for those closing tags, which can be interpreted two different ways outside of xhtml... Or so I think...

JALDesign
05-16-2011, 01:29 PM
<img src="../Images/logo_header.gif" width="267" height="65" alt="greenBOARDS logo" />

In both of the duplicate attribute problems the .dwt file had the ../ starting off the links to the image and the CSS. When I removed the .. and went just with...

<img src="/Images/logo_header.gif" width="267" height="65" alt="greenBOARDS logo" />

... in the .dwt file, the new pages created were fine. If this makes sense please let me know because I am more of a marketer and designer than a web guy. It was just that the /// seemed odd to me so I was wondering what must be creating the third "/". I deleted the ".." in front of it and bingo.

Do I need to do anything else or does this make sense? Will this still work when taked to the server or have I blundered somehow?

I don't want to go ahead and build the rest of the site if I've goofed.

Thanks again!

JALDesign
05-16-2011, 01:42 PM
Thank you John. My idea didn't work when I viewed it in a browser but yours did. Thank you so much. Now I can get on with getting this done.
Cheers!

johnMoss
05-16-2011, 01:47 PM
glad I could help...

johnMoss
05-16-2011, 01:51 PM
Also you're attempted fix threw off your links. What those "..." mean are literally "go up one file for each dot. When links go looking for things in files, they need to be told what directory they are in and how to get there from where they are. So dot dot for example(..) means go up twice and slash (/) means go down one...

DWcourse
05-16-2011, 02:25 PM
BTW, when you have liks starting with file:/// they are pointing to files on your local hard drive. They won't work when the page is uploaded. It's usually (but not always) caused by a problem with site definition. If things are set up right you can just reinsert the link or image and that should fix it.

Also, templates are stored in a Templates folder in your root folder. So, if you use document relative links to files on your site, they should always start with ../. DW will adjust the link when you create a new file from the template.