Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Folder levels being added to links

Running a Weblog.

I have links generated automatically in my Index pages.

There are two levels. The top level creates a front page, from which individual articles are linked to a weekly composite "archive" page. The URL is specified in the index page body using a combination of variables and hard code. Somehow, additional levels of folders get added at publish time.

http://www.babytrollblog/archives/04_02_15/04_02_15.htm

gets transformed into

http://www.babytrollblog/archives/04_02_15/archives/04_02_15/04_02_15.htm

If I use absolute links, the page "forgets" where all of the graphics are. I can't use relative and absolute links in the same site.

So I tried to make a 404 page. I placed it in the archives folders. When I publish *it*, the graphics are nothing but little red X's. In the View Source window, everything looks fine. But when I examine the properties of the actual graphics, they, too have these extraneous levels of folders gratuitously inserted into their URLs.

How can I stop this?

M

Mark Alger
Sunday, February 22, 2004

I think you need to show us your script(s).

www.MarkTAW.com
Monday, February 23, 2004

Show you scripts. I hope I can do this right. ::grin::

Comments in //

//master index file//

{$setDateTimeFormat "English" "dddd MMMM d, yyyy" ""$}
<p>{$ forEach x in (and (folder "archives/*") (today) (keywordContains "ellipses") (not (keywordContains "archead"))) sortDescendBy .filedDate $} </p>
<p><h3><i>{$x.headline$}</i></h3></p>
<blockquote>{$x.body$}</blockquote>
<p>{$ next $}</p>

//The Ellipses is a series of posts in a single file. Each has its own hand-coded comments code that tracks to a name anchor at the top of the post.//

<p><hr class="thin"></p>

<p>{$setDateTimeFormat "English" "dddd MMMM d, yyyy" ""$}</p>
<p>{$ forEach x in (and (folder "archives/*") (today) (not(keywordContains "ellipses")) (not (keywordContains "archead"))) sortDescendBy .filedDate $} </p>
<p><a name="{$x.fileName$}"><i>{$x.headline$} ::.</i></a></p>
<blockquote>{$x.body$}</blockquote>
<blockquote><p class="dsig"><i>{$ x.author $}&nbsp;&nbsp;</i><a href="/archives/{$x.extra1$}/{$x.extra1$}.htm#{$x.fileName$}"><img src="PTMFOG0000000137.gif" border="0" /></a><br /><a href="javascript:HaloScan('{$x.headline$}');" target="_self"><script type="text/javascript">postCount('{$x.headline$}');</script></a></p></blockquote>
<p>{$ next $}</p>

//These are non-ellipses (longer, more-detailed) posts, each in a discrete file. The x.extra1 field contains the name of the archive, which is the Sunday date that week--YY_MM_DD ... e.g. 04_02_22.//

<p><hr class="thin"></p>

<p>{$ forEach 5 x in (and (folder "archives/*") (before today) (not (keywordContains "archead"))) sortDescendBy .filedDate $}</p>
<p><i>{$x.filedDate$}</i></p>
<p><h3 class="left"><a name="{$x.fileName$}">{$x.headline$}</a></h3></p>
<blockquote>{$x.body$}</blockquote>
<blockquote><p class="dsig"><i>{$ x.author $}&nbsp;&nbsp;</i><a href="/archives/{$x.extra1$}/{$x.extra1$}.htm#{$x.fileName$}"><img src="PTMFOG0000000137.gif" border="0" /></a><br /><a href="javascript:HaloScan('{$x.headline$}');" target="_self"><script type="text/javascript">postCount('{$x.headline$}');</script></a></p></blockquote>
<p>&nbsp;</p>
<p>{$ next $}</p>

//This set are the most-recent posts before today. The filename is the headline. I would prefer to use all one or the other, but they don't appear to work the same in my application.//

<p><hr class="thin"></p>

//Then, in the archive header file (keywordContains "archead")//

{$forEach x in (and (thisFolder) (not (thisArticle))) sortDescendBy .filedDate $}
<p>{$setDateTimeFormat "English" "dddd MMMM d, yyyy" ""$}</p>
<p class="small"><i>{$x.filedDate$}...</i></p>
<p><a name="{$x.fileName$}"><h3 class="left">{$x.headline$} ::.</h3></a></p>
<blockquote>{$x.body$}</blockquote>
<blockquote><p class="dsig"><i>{$ x.author $}&nbsp;&nbsp;</i><br />
<a href="javascript:HaloScan('{$x.headline$}');" target="_self"><script type="text/javascript">postCount('{$x.headline$}');</script></a></p></blockquote>
<p>{$ next $}</p>

//Note that there no permalink here. This is what's munged and I have removed it. The goal is to preserve the same link throughout the process, from "today's" post through to permanent archive status. But, as I said in my original post, I can't get it to work.//

//An ellipses post (stripped of content)

<a name="9"></a>
//content goes here//

<p class="dsig"><i>{$.Alger$}</i>&nbsp;&nbsp;<a href="./archives/04_02_22/2004_02_27.htm#9">
<img src="PTMFOG0000000137.gif" border="0" /></a><br /><a href="javascript:HaloScan('2004_02_27.9');" target="_self"><script type="text/javascript">postCount('2004_02_27.9');
</script></a></p>

//The img is a "click-here" graphic. The {$.Alger$} variable returns a string of the author's name. (There are two.) The string that gets repeated in my glitch is the "/archives/04_02_22/"//

//You can see this in operation at http://www.babytrollblog.com/ //

I hope this isn't too confusing. And TIA for any help that can be forthcoming.

M

Mark Alger
Saturday, February 28, 2004

*  Recent Topics

*  Fog Creek Home