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, and the page your include tag is on is the newpage.tmpl - which is inside the subfolder. So when you put relative links in your headers.inc file, the browser adds the path to the newpage.tmpl - not the path to the headers.inc file.If you want to use a headers.inc file as a global file to be included in templates that reside in other folders, you have to put absolute URL's - not relative URL's - in the headers.inc file ... :)Sincerely, Ken Grome WebDNA Solutions http://www.hui.net/dna/webdna.html Associated Messages, from the most recent to the oldest:

    
  1. Re: [include] affect on filepaths for links? (bob 1997)
  2. Re: [include] affect on filepaths for links? (Kenneth Grome 1997)
  3. [include] affect on filepaths for links? (Dale Stokdyk 1997)
>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, and the page your include tag is on is the newpage.tmpl - which is inside the subfolder. So when you put relative links in your headers.inc file, the browser adds the path to the newpage.tmpl - not the path to the headers.inc file.If you want to use a headers.inc file as a global file to be included in templates that reside in other folders, you have to put absolute URL's - not relative URL's - in the headers.inc file ... :)Sincerely, Ken Grome WebDNA Solutions http://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:

WebDNA Server Not Running (2005) Sku numbers (1997) WebCatalog for guestbook ? (1997) different show next (1997) Wanted: Broader string manipulation functions (1997) Filemaker Pro Template for Orders (1999) Limit on nested [ShowIf]'s? (1997) international time (1997) ShowNext (was New WebCatalog Site) (1997) A quickie question (1997) WebCat2b13MacPlugIn - syntax to convert date (1997) Help! WebCat2 bug (1997) final on include (1997) Search Questions (2000) can webcat determine an image's pixel dimensions? (2000) RequiredFields parameter (1998) embedded showif statements (2000) Why is my easy [AddLineItems] NOT working?? (2000) Bug in capitalize ... ? (2003) BW in a search (2007)