PDA

View Full Version : Templates Not Updating Links.


johne281
09-08-2009, 11:25 PM
Hi I am building an ecommerce site (www.beatminesamples.com). My problem is this...

I have a template that controls the info pages for all of my items, another for information pages, and another for a gallery display of my items. On the rightbar of these pages is a bestseller showcase. Each item in the showcase has an image and the name. Both the image and the name are linked to take you to the info page of the item. Somehow the links got messed up and the links look like this

beatminesamples.com/products/products/"item.html"

instead of this

beatminesamples.com/products/"item.html"

Needless to say, the extra product in the URL is not wanted. I have tried updating the links in the template and reuploading the new files to the server but it has no effect. The code looks fine in dreamweaver. I am completely stuck. I don't wanna have to redo my page. Any suggestions.

DWcourse
09-09-2009, 12:45 AM
Actually all of your links look like this product/xxxxxx.html which means they work at the top level of your site but not inside folders within your site. That link is relative to the current document and it looks for a product folder in the same folder as the current document. So in the your product pages it's looking for a product folder inside the product folder!

If things were set up right and the links are in a non-editable portion of the template they should have updated correctly. But I suspect that's not the case.

The simple solution is to make the links site relative like this /product/xxxxxx.html (backslash in front of link). That will work inside any folder in your site.

johne281
09-09-2009, 04:31 AM
Yeah that was my first guess. I did make all of the links site rooted in both the site definition window and the template. I then reuploaded the template files and there was no change on the site. It still does the same thing. If you check the website, the bestseller links work fine on the index page but that is the only page they work on. All the other pages are linked to those three templates (which I updated). I'm completely stuck as to what I should do now. Any other suggestions....besides redoing the templates :(

DWcourse
09-09-2009, 12:33 PM
When you change a Dreamweaver template you have to allow it to updated the pages that were based upon it and then upload those pages. The template file itself doesn't do anything online. In fact it doesn't even have to be uploaded for the site to work.

johne281
09-09-2009, 05:08 PM
Not exactly sure if I get what you are saying? I did let the pages update. I deleted the files on the server and reuploaded them but it still does the same thing. Basically after I redid the links I reuploaded the site again but there is still no change.

DWcourse
09-09-2009, 05:12 PM
The links on the broken pages are document not site relative.

If you uploaded the changed files and the files on the server are not the same as the files on your hard drive then you've probably got the remote site info configured incorrectly. It's usually the Host Directory setting that needs adjusting.

johne281
09-09-2009, 05:13 PM
When I preview the index file in Firefox through dreamweaver I can see that those best seller links are not finding the root folder. The other links point from the root from the hard drive to the folder down to the specific file location but those broken bestseller links start at file///product/"itemname.html"

johne281
09-09-2009, 05:15 PM
I am uploading using a seperate program, not dreamweaver. I was using filezilla but then I got core ftp when this started happening. I wasnt sure if filezilla was causing a problem. It is happening regardless of which one i use though.

DWcourse
09-09-2009, 05:16 PM
You can't look at the source of the preview. DW has to adjust the links to work on your computer. Look at the source IN Dreamweaver and compare it to the source of the files online.

DWcourse
09-09-2009, 05:19 PM
I am uploading using a seperate program, not dreamweaver. I was using filezilla but then I got core ftp when this started happening. I wasnt sure if filezilla was causing a problem. It is happening regardless of which one i use though.

In any case, the links on the product pages are document not site relative. Are those links in a locked or editable region in the template?

johne281
09-09-2009, 05:23 PM
/products/da_breaks1.html

Thats what the link says in DW and its site root relative. But online it says

products/products/da_breaks1.html

johne281
09-09-2009, 05:25 PM
In any case, the links on the product pages are document not site relative. Are those links in a locked or editable region in the template?


The links are in a locked region. But I edit the template itself so I didnt think that it would matter. Do I have to make the bestseller region editable to edit the already created pages. Shouldnt adjusting the template adjust the child pages?

DWcourse
09-09-2009, 05:48 PM
/products/da_breaks1.html

Thats what the link says in DW and its site root relative. But online it says

products/products/da_breaks1.html

Then you're either not uploading them or loading them to the wrong place.

If you look at the SOURCE CODE of the online pages, the links are products/da_breaks1.html which are document relative.

<a href="products/da_breaks1.html">

johne281
09-09-2009, 08:39 PM
But I selected them as site rooted in the menu :( Do you know the code i need to make them site root relative

johne281
09-09-2009, 08:42 PM
Also that is the folder structure. /rootfolder/product/item.html

coloeagle
09-10-2009, 01:06 AM
But I selected them as site rooted in the menu :( Do you know the code i need to make them site root relative

To make it site-root relative you need to have a slash at the beginning.
<a href="/products/da_breaks1.html

johne281
09-10-2009, 02:52 AM
Ok thats what I thought. I changed the templates to where the bestseller area is inside an editable region. I did this in all 3 templates and reuploaded the site. Now it is working in the child pages of two of the templates. The bestseller images dont properly link to the item pages though. The titles under them have the correct link but the images are missing the "/product/" in the url now. The code looks fine in the templates so what is the deal?

johne281
09-10-2009, 03:06 AM
Ok, I have to go to each page and edit those images individually. It is working but I still dont understand why I editing the templates locked region wouldnt edit the child pages. That means if I want to change something, such as the nav bar, I will have to make it an editable region and change it on every page? That nulls the advantage of using templates almost.

domedia
09-10-2009, 09:38 AM
Stuff that are common across the website should go into your dwt template file. That's the whole point.

johne281
09-10-2009, 01:17 PM
ok thats past obvious. Nice +1 for your posts.

domedia
09-11-2009, 01:47 AM
johne, howcome the template system will not work for you, did you set up your site definitions right?