Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

withAbsoluteLinks seems to bleed

I added this to a template and a index page:

{$ withAbsoluteLinks "" $}

and suddenly a lot of links on other pages got that as well. Is this setting supposed to be a local one for the page, or a global one for the whole site ?

In any case there's a bug here, because the change didn't happen on all pages, perhaps it only happened on the files rebuilt after this one was encountered ?

I ended up adding a setting with "" on all templates just to be sure that I got the right setting.

Lasse Vågsæther Karlsen
Monday, August 25, 2003

global for the whole site...... I believe. Have you checked the documentation?
Monday, August 25, 2003

Yea, I know that one too. I forgot to send it in though. =(

Henrik Jernevad
Monday, August 25, 2003

sorry "Including this in an article or file will cause all internal links in that file to be written out as absolute links"
Monday, August 25, 2003

Mark, it's not supposed to be global:

From CD help: "Including this [a withAbsoluteLinks statement] in an article or file will cause all internal links in that file to be written out as absolute links".

Henrik Jernevad
Monday, August 25, 2003

Cool. We're posting the same thing at the same time.. =)

Cheers, Mark. =D

Henrik Jernevad
Monday, August 25, 2003

Monday, August 25, 2003

You said you added it to a template -- I would expect all articles based on that template to inherit the setting. Maybe you meant something else by "template"?

Monday, August 25, 2003

I suppose he ment that even articles that was not using the template in question, was affected.

Henrik Jernevad
Monday, August 25, 2003

I added it to one template, and yes, I would like all articles using that template to get the absolute link.

However, articles using a different template also got absolute links, when I had no {$ withAbsoluteLinks ... $} script tag in that template.

I had to specifically add a {$ withAbsoluteLinks "" $} to all other templates to stop the bleeding from happening.

Also note that not all other articles got absolute links, only some, and not even all other articles based on one template, so it seemed kinda random.

Lasse Vågsæther Karlsen
Tuesday, August 26, 2003

I've noticed the same thing, but when I added {$ withAbsoluteLinks $} to an article that is included into another.

It seems to me that all articles that are parsed after the article that pulls in the amended article all have absolute links.

For example, if in my site tree I have:

--> ArticleWithAbsLinks
--> ArticleF
--> ArticleG

If ArticleC includes "FolderA/ArticleWithAbsLinks" then all articles from "ArticleC through to ArticleG get absolute links.

I expected it in ArticleC (well, actually I only expected it in the published section of ArticleC that contains the included article), but I did not expect all the other articles that are parsed after ArticleC to get Abs Links too.

This happend with CD v2.0.17 on Win XP Pro, clean save for CD and all Windows Update patches (i.e. no other non-bundled apps installed).

I've yet to try this with CD v2.0.19, hopefully I will get a chance this evening.

Tuesday, August 26, 2003

Here's what I found with CD 2.0.19.

After making a new site with two articles, with only a {$ .link $} text, and one include file which has {$ withAbsoluteLinks "" $}, I've found the following:

If I include the include file into the "a" article, both this article, the "b" article and even the index article has gotten absolute links all over. This means that the style sheet etc. is now linked to cnn.

I would expect only the include file to get absolute links, as this is (as far as I know) supposed to be a local setting. I would not expect this setting to bleed to the page that includes this file, and certainly not the index or the other file.

The questions that needs answers by FogCreek then are:
- is withAbsoluteLinks supposed to be local to the file it is in ?
- if not, where will it bleed ? to a file that includes the file with it in ? to an index page ?

if it is supposed to be local, then it's a bug, otherwise it must be documented better.

Lasse Vågsæther Karlsen
Wednesday, August 27, 2003

WithAbsoluteLinks affects the entire published file that it appears in, even if it appears as the result of an include or something else.

Joel Spolsky
Wednesday, August 27, 2003

Follow these steps to create a situation where withAbsoluteLInks bleed.

1. Create a new CD 2.0 site.
2. Create a new template called "Other".
3. Copy the content of the template "Simple" into "Other" but add {$withAbsoluteLinks ""$} somewhere.
4. Close the template.
5. Make a clone of the "Getting Started" article using copy/paste (both should be inside the "Articles" folder).
6. Open the clone article, change the headline to "Using other template" and change it's template into "Other".
7. Click preview or publish.

Note that also the original "Getting started article" has absolute links, although it's still using the "Simple" template and the only thing it has in common with the second article is being in the same folder.

Henrik Jernevad
Wednesday, August 27, 2003

Has anyone seen an explanation from Fog Creek on this yet?

David Walker
Monday, November 3, 2003

*  Recent Topics

*  Fog Creek Home