Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

template base pages: relative paths don't update

New Here ,
Dec 03, 2008 Dec 03, 2008

Copy link to clipboard

Copied

Something mysterious has happened. In newly created template-based pages, the link and image paths are not updating. Eg. In template: /default.htm, on new saved page, the homepage link still reads /default.htm. When I preview in browser, the new page looks fine, so the images are intact even though the path didn't change. But if I click on a link to another page, it comes up with no images. Click one of the imageless links and it goes to "page not found". This has never happened to me before.

All my other websites have the link in the template written: ../default.htm and on the template based page: default.htm I take it one is site relative and one is document relative. I don't know how it got changed and don't know how to change it back. Even if it stays site relative though, the link should change on the new page to default.htm. And it won't!!!

Can someone help please?


TOPICS
Server side applications

Views

378
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 04, 2008 Dec 04, 2008

Copy link to clipboard

Copied

> In template: /default.htm

Root relative links don't, and shouldn't, change. Looks to me like you are
getting just what you should be. And, you should never click away from a
page using a root relative link - again, you are getting what you should be.

> All my other websites have the link in the template written:
> ../default.htm

That is a document relative link. It needs to be managed for each child
page document as it is saved, since the path is relative to the location of
that document.

> I don't know how it got changed

In the site definition, there is an option to make links root/document
relative. You have enabled the root relative one.

> Even if it stays site relative though, the link should change
> on the new page to default.htm.

No. It shouldn't change from a root relative to a document relative link
(which is what you have here).

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"Marney" <webforumsuser@macromedia.com> wrote in message
news:gh7q41$75j$1@forums.macromedia.com...
> Something mysterious has happened. In newly created template-based pages,
> the
> link and image paths are not updating. Eg. In template: /default.htm, on
> new
> saved page, the homepage link still reads /default.htm. When I preview in
> browser, the new page looks fine, so the images are intact even though the
> path
> didn't change. But if I click on a link to another page, it comes up with
> no
> images. Click one of the imageless links and it goes to "page not found".
> This
> has never happened to me before.
>
> All my other websites have the link in the template written:
> ../default.htm
> and on the template based page: default.htm I take it one is site
> relative and
> one is document relative. I don't know how it got changed and don't know
> how to
> change it back. Even if it stays site relative though, the link should
> change
> on the new page to default.htm. And it won't!!!
>
> Can someone help please?
>
>
>
>

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 04, 2008 Dec 04, 2008

Copy link to clipboard

Copied

Hi Murray,

Thanks for response. I understand what you are saying about root relative links but it's not working. If, eg, I preview default.htm in browers from DW, it's all there. Click any link and the images are gone. I read something that led me to upload to server and try. Then, even the default page images were gone. When I detached all from the template and editted all the code to make it doc relative, it all worked fine but that doesn't solve anything.

I looked at the site def'n and could see no way to make it doc relative again (DW MX). I created this def'n the same as always. I looked to see what would happen in another site that's years old.. suddenly it's doing this too.

Right now, this is my kid's first site for homework and mommy is not looking to smart. Any further thoughts?

Thanks.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 04, 2008 Dec 04, 2008

Copy link to clipboard

Copied

You are being confused by a) not understanding root relative vs document
relative links, and b) not understanding how DW previews files.

If I have a document with a link to an image that looks like this -

<img src="/images/foo.gif"...

That's what's called a root relative link.

If I preview that document in DW, then the browser gets the document, sees
the leading "/" and reads that as the root of the hard drive, since the
browser has no idea where the root of the site is. Thus, the image is
broken in the preview.

If I have temp files enabled, then DW will secretly convert the file being
previewed into a temporary file, and hand that to the browser. This temp
file has had all root relative links converted to document relative links
(as you will see by looking at the code in the browser), and has had all
include files actually embedded in the page, and has had all external CSS
and js markup embedded in the page. In other words, DW has made the
document into a stand-alone page.

If you do not have temp files enabled, all of these links would be broken on
preview.

Now - if you are using root relative links, AND you have temp files enabled,
AND you click away from the previewed document, then all of your links will
be broken, since DW has not made that linked file into a temp file. This is
what you are seeing.

So - if you want to click away on preview, then you must use document
relative links for the site -

<img src="../images/foo.gif"... (for example)

These will still work on preview since the browser knows how to determine
the current file's location and how to follow that path.

GEDDIT?



--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"Marney" <webforumsuser@macromedia.com> wrote in message
news:gh9arc$7qe$1@forums.macromedia.com...
> Hi Murray,
>
> Thanks for response. I understand what you are saying about root relative
> links but it's not working. If, eg, I preview default.htm in browers from
> DW,
> it's all there. Click any link and the images are gone. I read something
> that
> led me to upload to server and try. Then, even the default page images
> were
> gone. When I detached all from the template and editted all the code to
> make it
> doc relative, it all worked fine but that doesn't solve anything.
>
> I looked at the site def'n and could see no way to make it doc relative
> again
> (DW MX). I created this def'n the same as always. I looked to see what
> would
> happen in another site that's years old.. suddenly it's doing this too.
>
> Right now, this is my kid's first site for homework and mommy is not
> looking
> to smart. Any further thoughts?
>
> Thanks.
>

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 04, 2008 Dec 04, 2008

Copy link to clipboard

Copied

Hi again Murray.

Wow, you know how to make a person's cheeks turn pink. Amazing how I've gotten through 8 years of web design without having to deal with root relativity vs doc relativity. Anyway, I do understand the diff between the two and had some idea why the links weren't working just not how to return to doc relative.

I did not, however understand all you explained (very well I might say) about previewing root relative links because I have never used them, never want to and don't know why DW suddenly started saving my templates that way when it never has before.

So, I would be grateful if you could just tell me, please, how to get DW to save my templates as doc relative again rather than root relative. As previously mentioned, I see no option in the site definition and, as far as I know, haven't changed any settings. I do want to have to hand code it.

Thanks again. M.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 04, 2008 Dec 04, 2008

Copy link to clipboard

Copied

> don't know why DW suddenly started saving my templates that way when it
> never has before.

You told it to do so by selecting to use ROOT RELATIVE links in the site
definition as I said originally. Edit your site definition and un-enable
that option (it's immediately underneath the Default images folder field on
the Local Info page). Then you can get this extension and revert your
site -

relativity from Jason Delgarno

http://e7x.com/dw/

It has a dialog box and help files and it will change a single page, folder,
or sitewide from one method to the other.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"Marney" <webforumsuser@macromedia.com> wrote in message
news:gh9nbb$mqb$1@forums.macromedia.com...
> Hi again Murray.
>
> Wow, you know how to make a person's cheeks turn pink. Amazing how I've
> gotten
> through 8 years of web design without having to deal with root relativity
> vs
> doc relativity. Anyway, I do understand the diff between the two and had
> some
> idea why the links weren't working just not how to return to doc relative.
>
> I did not, however understand all you explained (very well I might say)
> about
> previewing root relative links because I have never used them, never want
> to
> and don't know why DW suddenly started saving my templates that way when
> it
> never has before.
>
> So, I would be grateful if you could just tell me, please, how to get DW
> to
> save my templates as doc relative again rather than root relative. As
> previously mentioned, I see no option in the site definition and, as far
> as I
> know, haven't changed any settings. I do want to have to hand code it.
>
> Thanks again. M.
>
>

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 04, 2008 Dec 04, 2008

Copy link to clipboard

Copied

Last post: In my version of MX, there was NO OPTION in site def'n to choose root or document relativity. No idea why. So I finally upgraded to CS3 and it is there. Problem solved. Thank you for your help and for the relativity link. Marney

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 04, 2008 Dec 04, 2008

Copy link to clipboard

Copied

LATEST
Good luck Marney!

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"Marney" <webforumsuser@macromedia.com> wrote in message
news:gh9vr3$3kp$1@forums.macromedia.com...
> Last post: In my version of MX, there was NO OPTION in site def'n to
> choose
> root or document relativity. No idea why. So I finally upgraded to CS3 and
> it
> is there. Problem solved. Thank you for your help and for the relativity
> link.
> Marney
>

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines