Forum Moderators: open

Message Too Old, No Replies

dreamweaver - trouble with links

can't figure this out - css and images

         

sldesigns

5:27 pm on Jan 17, 2005 (gmt 0)

10+ Year Member



I've set up templates and pages in dreamweaver mx, and link to one style sheet. Once I turned off the dumb "preview with temp file" I can see my links aren't working. I've tried moving files around (for instance, moving "about" template into "about" folder so the link would be the same as the "about" pages). I've tried letting dreamweaver handle the links as relative, then change them to site root.

I realize that it's probably something so stupid and obvious no one even needs to discuss it but it's driving me nuts!

It has been a little while since I've done web work (last used dreamweaver 4) but it still looks the same. And why would it look different in temp view vs real view?

sonjay

1:38 pm on Jan 18, 2005 (gmt 0)

10+ Year Member



For starters, don't move your "about" template or any other template to any folder other than the DW-created Templates folder. DW wants its templates to live there, and expects to find them there, and you break its link-management capability if you move the templates.

If you're using site root-relative links (what I've always called an "absolute path"), you need to use DW's "preview with temp file" feature. The reason for this is: Since your computer isn't a web server and doesn't know what the root of your site is, it doesn't know how to handle site-root relative links. Thus, DW's "preview with temp" feature creates a temp file that DOES handle site-root relative links properly. Of course, when you click a link in that temp file to another file in the site, your browser just loads the regular file -- and again, your computer doesn't know what your site root is, so the file you clicked to from the temp file won't have working links.

But if you're using site-root relative links without DW's "preview with temp" feature, then when you preview, none of the links in the previewed page will work -- because your computer doesn't know what your site root is.

You should keep your templates in DW's Templates folder, and keep nothing else in there, and you should not rename that folder. You should not move your templates anywhere else. If you need to move other files around in your site, you should always do it from within DW, so that it can re-write the links as necessary.

sldesigns

5:54 pm on Jan 18, 2005 (gmt 0)

10+ Year Member



First, thanks for your patience.
I have a folder for the site, which in turn has folders for each section (they have their own image folders as well as html docs), a folder for templates (one for each section), a folder for css (only one currently), an images folder, and index.html. The images that are called from css are in the css folder.
The layout is hybrid tables/css. The site is set up with the local root folder, images folder, and home page pointing to the correct place. I typed the final http address in. When I upload it, I’m loading to a folder within my web space for testing/approval.
Here is a portion of code:

<link href="../css/site.css" rel="stylesheet" type="text/css">
<!-- InstanceBeginEditable name="pagecss" -->
<style type="text/css" media="screen">
td#solutions a:link, td#solutions a:visited {
background: url(../css/nav2.gif);
color: #FFFFCC;
}
</style>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable --></head>
<body bgcolor="#FFFFFF">
<table id="nav" width="780" border="0" align="center" cellspacing="0" cellpadding="0">
<tr>
<td id="colorbar" height="12" colspan="7" bgcolor="333">&nbsp;</td>
</tr>
<tr>
<td id="home" height="80" colspan="2" bgcolor="a89d90"><!-- InstanceBeginEditable name="logo" --><a href="../index.html"><img src="../images/InfoTlogo.gif" width="200" height="80" border="0" align="top"></a><!-- InstanceEndEditable --></td>
<td id="topgraphic" height="110" colspan="4" rowspan="2"><!-- InstanceBeginEditable name="photo" --><img src="../images/topper1.jpg" width="415" height="110" align="top"><!-- InstanceEndEditable --></td>

You can see I’ve added dots <link href=”../ css/site.css > to the front of each link areas. If I don’t add the dots, the links don’t work either as site root ( /css/site.css) or relative to document (site.css) in DW preview or live pages. Yes, it shows properly when DW is set to use a temp file at preview in browser, but doesn’t when viewing the actual file. What I’ve been doing is setting links using site root or absolute, then adding the dots so I can see the page. Since css is a big part of the design, I need to have the link work to view it properly.

I can’t see what it is I’m doing incorrectly. I appreciate your help.

sldesigns

4:13 am on Jan 19, 2005 (gmt 0)

10+ Year Member



I got it. I knew it was something really dumb. I had moved the template out of the folder then back into the folder, which doesn't work. New template, copy/paste pages, and I'm back on track. Thanks for the entry that pointed me in the right direction.