Re[2]: Using [Include] Context

This WebDNA talk-list message is from

1999


It keeps the original formatting.
numero = 24705
interpreted = N
texte = Your analysis of relative vs absolute is absolutely correct, but I have to quibble with one aspect of your analysis. With respect to WebCatalog include files, indeed the root slash under NT points to the WebCatalog directory itself, rather than the site root directory. However, all HTML code which is handled by the web browser, like all IMAGE files, the slash is relative to the virtual root HTDOCS directory.When I have designed WebCatalog sites in the past, I always have put the static elements in the HTDOCS directory tree, and all templates in a subdirectory of the WebCatalog directory itself. This includes all graphical elements. I then code all pages except the database entry page using relative addressing. This includes all of the active pages as well as any static HTML pages. The sole exeption is all graphic elements are root pathed to the virtual root for that site. This enables me to have a test site resident on the same system, sharing the same virtual root, and with a seperate WebCatalog directory under ./WebCatalog/localhost/domain/... This allows me to test my new active pages and copy the files unchanged to the live site. The only alteration I need to make is the one link in the first active page, which sets the relative home directory for the rest of the template files. I delete that sole instance of /localhost and my site is live.John Peacock ____________________Reply Separator____________________ Subject: Re: Using [Include] Context Author: (WebCatalog Talk) Date: 11/20/99 7:26 PMThe key is in how you interpret the word relative in this context. Relative to the current document, or relative to the root. Webcatalog is expecting the former. On NT, root relative is further confused by the fact that the leading slash in the path actually points to the Webcatalog directory in the scripts directory, instead of the expected web site root. What you need to do is create a document relative path, such as [include file=../include/filename.txt] which will work on all platforms. In fact, in html as well as webdna, using root relative or semi-qualified paths can, and usually will, make your web site non-portable. References such as src=/images/header.gif will lock your web site in the directory structure that it's in now, needing code revision to move the site to a new server that may use different server software or directory structures. Simple answer: where possible, always use ../filepath/ (document relative) file paths instead of /filepath/ (root relative) file paths, whether in your WebDNA or in your HTML.Mike> From: Vince Medina > Reply-To: (WebCatalog Talk) > Date: Thu, 11 Nov 1999 21:52:30 > To: (WebCatalog Talk) > Subject: Using [Include] Context > > When using an [include file=/include/filename.txt] > We get a file not found error. > > As I understand the syntax, the path should be relative to virtual root path > where my htdocs dir is. > > For example: If the site is www.test.com then it should include a file > located in http://www.test.com/include/filename.txt > > Is there something I am missing? > > Vince > > > APC Net, Inc. - sales@apcn.net - www.apcn.net > 4471 NW 36 St. #110 - Miami Springs, FL 33166 > > > > ------------------------------------------------------------- > Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. > To end your Mail problems go to . > > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > ------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Associated Messages, from the most recent to the oldest:

    
  1. Re[2]: Using [Include] Context ( 1999)
  2. Re[2]: Using [Include] Context ( 1999)
  3. Re: Re[2]: Using [Include] Context (J. A. Hill 1999)
  4. Re[2]: Using [Include] Context ( 1999)
Your analysis of relative vs absolute is absolutely correct, but I have to quibble with one aspect of your analysis. With respect to WebCatalog include files, indeed the root slash under NT points to the WebCatalog directory itself, rather than the site root directory. However, all HTML code which is handled by the web browser, like all IMAGE files, the slash is relative to the virtual root HTDOCS directory.When I have designed WebCatalog sites in the past, I always have put the static elements in the HTDOCS directory tree, and all templates in a subdirectory of the WebCatalog directory itself. This includes all graphical elements. I then code all pages except the database entry page using relative addressing. This includes all of the active pages as well as any static HTML pages. The sole exeption is all graphic elements are root pathed to the virtual root for that site. This enables me to have a test site resident on the same system, sharing the same virtual root, and with a seperate WebCatalog directory under ./WebCatalog/localhost/domain/... This allows me to test my new active pages and copy the files unchanged to the live site. The only alteration I need to make is the one link in the first active page, which sets the relative home directory for the rest of the template files. I delete that sole instance of /localhost and my site is live.John Peacock ____________________Reply Separator____________________ Subject: Re: Using [include] Context Author: (WebCatalog Talk) Date: 11/20/99 7:26 PMThe key is in how you interpret the word relative in this context. Relative to the current document, or relative to the root. Webcatalog is expecting the former. On NT, root relative is further confused by the fact that the leading slash in the path actually points to the Webcatalog directory in the scripts directory, instead of the expected web site root. What you need to do is create a document relative path, such as [include file=../include/filename.txt] which will work on all platforms. In fact, in html as well as webdna, using root relative or semi-qualified paths can, and usually will, make your web site non-portable. References such as src=/images/header.gif will lock your web site in the directory structure that it's in now, needing code revision to move the site to a new server that may use different server software or directory structures. Simple answer: where possible, always use ../filepath/ (document relative) file paths instead of /filepath/ (root relative) file paths, whether in your WebDNA or in your HTML.Mike> From: Vince Medina > Reply-To: (WebCatalog Talk) > Date: Thu, 11 Nov 1999 21:52:30 > To: (WebCatalog Talk) > Subject: Using [include] Context > > When using an [include file=/include/filename.txt] > We get a file not found error. > > As I understand the syntax, the path should be relative to virtual root path > where my htdocs dir is. > > For example: If the site is www.test.com then it should include a file > located in http://www.test.com/include/filename.txt > > Is there something I am missing? > > Vince > > > APC Net, Inc. - sales@apcn.net - www.apcn.net > 4471 NW 36 St. #110 - Miami Springs, FL 33166 > > > > ------------------------------------------------------------- > Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. > To end your Mail problems go to . > > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > ------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to

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:

WebCat2 - [format thousands] (1997) Re:no [search] with NT (1997) WebCommerce: Folder organization ? (1997) Web Catalog 2 demo (1997) [OT] Internet connection problem (2003) Resume Catalog ? (1997) Document Contains No Data! (1997) find with exceptions (1997) taxTotal, grandTotal (1997) Document Contains No Data! (1997) [WebDNA] fast free WebDNA hosting + web based IDE (2015) update problem (1998) Proposed FormVariables hierarchy (2000) WebCat2 as a chat server? (1997) Webmerch Error (1998) [WebDNA] .htm files (2008) Location of Browser Info.txt file (1997) emailer error -108 (1997) [WebDNA] testing (2012) Navigator 4.01 (1997)