Re: [include] affect on filepaths for links?
This WebDNA talk-list message is from 1997
It keeps the original formatting.
numero = 12866
interpreted = N
texte = >Hi! Got an unexpected result with [include] yesterday when tried to use>it to apply a header.inc I created to a new page.>>The new page is in a folder in the Store and the Globals are in a>folder at the Root level:>>>Server (Root Folder)> |> Globals -- header.inc> |> Store -- search.tmpl results.tmpl etc.> |> Subfolder -- newpage.tmpl>>>The [include] works fine, *except* that I noticed that the links in my>header.inc are changed for newpage.tmpl -- it inserts the name of>the Subfolder into the link. For example,>>
>becomes>>>which, of course, result in an error message for the unfound template.>>I'm scratching my head...what did I miss?You have to think of the [include] as part of the page the tag is on, andthe page your include tag is on is the newpage.tmpl - which is inside thesubfolder. So when you put relative links in your headers.inc file, thebrowser adds the path to the newpage.tmpl - not the path to theheaders.inc file.If you want to use a headers.inc file as a global file to be included intemplates that reside in other folders, you have to put absolute URL's -not relative URL's - in the headers.inc file ... :)Sincerely, Ken GromeWebDNA Solutionshttp://www.hui.net/dna/webdna.html
Associated Messages, from the most recent to the oldest:
>Hi! Got an unexpected result with
[include] yesterday when tried to use>it to apply a header.inc I created to a new page.>>The new page is in a folder in the Store and the Globals are in a>folder at the Root level:>>>Server (Root Folder)> |> Globals -- header.inc> |> Store -- search.tmpl results.tmpl etc.> |> Subfolder -- newpage.tmpl>>>The
[include] works fine, *except* that I noticed that the links in my>header.inc are changed for newpage.tmpl -- it inserts the name of>the Subfolder into the link. For example,>>
>becomes>>>which, of course, result in an error message for the unfound template.>>I'm scratching my head...what did I miss?You have to think of the [include] as part of the page the tag is on, andthe page your include tag is on is the newpage.tmpl - which is inside thesubfolder. So when you put relative links in your headers.inc file, thebrowser adds the path to the newpage.tmpl - not the path to theheaders.inc file.If you want to use a headers.inc file as a global file to be included intemplates that reside in other folders, you have to put absolute URL's -not relative URL's - in the headers.inc file ... :)Sincerely, Ken GromeWebDNA Solutionshttp://www.hui.net/dna/webdna.html
Kenneth Grome
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
Searching multiple Databases (1997)
Login Page & [Protect] (2001)
Crashing Server (2000)
Exclamation point (1997)
Webcat2, WebCommerce, Mod 10 etc. (1997)
Nested tags count question (1997)
Late on Friday.... brain fried (2002)
Taget _top (2000)
[WebDNA] exclusive lock prevents dbs from closing (2011)
WCS Newbie question (1997)
SQLCONNECT (2005)
possible, WebCat2.0 and checkboxes-restated (1997)
Calendar (1997)
Checkboxes (1997)
Variables from a long text string (2000)
[SearchString] usage (1997)
unable to launch acgi in WebCat (1997)
It just Does't add up!!! (1997)
Sendmail & Time Issue (2001)
Keep away (1997)