4DINCLUDE tag

Atanas Atanassov (11/19/08 12:20PM)
Atanas Atanassov (11/19/08 12:42PM)
Justin Leavens (11/19/08 6:22PM)
Add Komoncharoensiri (11/19/08 8:35PM)


Atanas Atanassov (11/19/08 12:20 PM)

Justin Leavens wrote:

On Mon, Oct 20, 2008 at 9:04 AM, Keith R. White
<KWhite@... wrote:

Hello

What's with the 4DINCLUDE tag?

Why can't I use 4DINCLUDE /web/include/MyInclude.shtml ?

4D 2004 only seems to accept a relative path    include/MyInclude.sh
tml

There also seems to be a difference between 4D 2004 and 4D v11 SQL.

4D 2004 likes  include/MyInclude.shtml

4D v11 SQL likes  ../include/MyInclude.shtml

Using an absolute path would make it clearer, but 4D won't have it.

Yeah, I'm missing a "trick" here as well in v11.2. I can't get

includes to work at all. I'm trying to use 4DINCLUDE tags in a file

that is coming from outside of the designated web folder being sent

using SEND HTML FILE, and all I get is "document cannot be opened". My

setup is this:

MyWebRoot:

 mainpage.shtm

4DWebRoot:

 includes:

  debug.shtm

I've tried:

<!--#4DINCLUDE ../includes/debug.shtm-->

<!--#4DINCLUDE /includes/debug.shtm-->

<!--#4DINCLUDE includes/debug.shtm-->

I've also tried putting the debug.shtm file directly in the 4DWebRoot

folder with all the above combinations and still got the same result.

Hi Justin,

Change the file extantion from shtml to html, put the file next to
your

index.html file! Also set the Contextual mode in the Preferences/Web

--Atanas

Atanas Atanassov (11/19/08 12:42 PM)

Atanas Atanassov wrote:

Justin Leavens wrote:

On Mon, Oct 20, 2008 at 9:04 AM, Keith R. White

<KWhite@... wrote:

Hello

What's with the 4DINCLUDE tag?

Why can't I use 4DINCLUDE /web/include/MyInclude.shtml ?

4D 2004 only seems to accept a relative path    include/MyInclude.sh
tml

There also seems to be a difference between 4D 2004 and 4D v11 SQL.

4D 2004 likes  include/MyInclude.shtml

4D v11 SQL likes  ../include/MyInclude.shtml

Using an absolute path would make it clearer, but 4D won't have it.

Yeah, I'm missing a "trick" here as well in v11.2. I can't get

includes to work at all. I'm trying to use 4DINCLUDE tags in a file

that is coming from outside of the designated web folder being sent

using SEND HTML FILE, and all I get is "document cannot be opened". My

setup is this:

MyWebRoot:

 mainpage.shtm

4DWebRoot:

 includes:

  debug.shtm

I've tried:

<!--#4DINCLUDE ../includes/debug.shtm-->

<!--#4DINCLUDE /includes/debug.shtm-->

<!--#4DINCLUDE includes/debug.shtm-->

I've also tried putting the debug.shtm file directly in the 4DWebRoot

folder with all the above combinations and still got the same result.

Hi Justin,

Change the file extantion from shtml to html, put the file next to

your index.html file! Also set the Contextual mode in the
Preferences/Web

--Atanas

Hi Justin ,

Please, ignore my first replay. You should not use contextual mode to

make 4DINCLUDE to work!

In the Preferences/Web, change the Default Home Page(where is your 4D

INCLUDE tag) to Index.shtml

Place, your debug.shtml file next to the index.shtml file in the

WebFoldef. Make sure the extension is shtml not shtm!

--Atanas

Justin Leavens (11/19/08 6:22 PM)

<96f59e830811191822o4c0eb866y7f9bf0720aaf4a48@...

On Wed, Nov 19, 2008 at 5:53 PM, Add Komoncharoensiri <add@...
wrote:

Justin,

I'm quoting the language ref here:

"In the case of a 4DINCLUDE call, the path is relative to the document
being

analyzed, that is, the "parent" document"

Perhaps this is the problem.

Now I did a quick test here just to make sure that follow your step
correct.

This is what I did:

- Next to the .4DB file and create a file named a.html. Here is the
content

of the file:

<html>

  <body>

  Hello

  <!--#4DINCLUDE Webfolder/TEST.HTML-->

  </body>

</html>

- In the same folder as .4DB, I create a folder named Webfolder.
Inside I

create a file named TEST.HTML. Here is the code I have inside
TEST.HTML:

<html>

  <body>

  <b>MMy Included content</b>

  </body>

</html>

- In Preference, I set the Default Home Page to an empty string.

- In the On Web Connection, I add the following line of code to it:

SEND HTML FILE(Get 4D folder(Database Folder )+"a.html")

When I connect to it, I get the right result in return.

So here is what I think your problem is. The path that you specify in
the

4DINCLUDE tag must be relative to the file that you are sending.

That would be a bit strange, because then we're heading into that area

where 4D would be sending files outside of the HTML root folder, which

is what David was just saying was so dangerous. Also, since the two

folders are at the same level, this should have worked:

<!--#4DINCLUDE ../includes/debug.shtm-->

Again, just to be clear...

I am using SEND HTML FILE to send this document:

/application/mywebdocs/doc.shtm

That document includes a <!--#4DINCLUDE debug.shtm--> and there is a

file in the directory:

/application/4dhtmlroot/debug.shtm

I can access debug.shtm at the URL: http://www.myapp.com/debug.shtm

But my <!--#4DINCLUDE debug.shtm--> tag always gets parsed to:

<!--4DINCLUDE debug.shtm--> : The document cannot be opened.

4DINCLUDE is not a complicated tag: Other than requiring you to

specify a document within the 4D HTML Root directory, there's not much

to it. These includes worked just fine in 4D 2004 in this same

organization.

--

Justin Leavens, President

Just In Time Consulting, Inc.

justin@... / (818) 986-7298 phone / (818) 474-8580
fax

4D Consulting, AcctVantage/A4/Foresight Financials Specialist,

Certified Apple Consultant

www.justintimebusiness.com

Add Komoncharoensiri (11/19/08 8:35 PM)

Justin,

I know exactly what David is saying. However, this only works from the

4DINCLUDE which is processed on the Server side. There is no direct
access

to any other files in the system outside of the Webfolder. The client
side

will not see this information. By the time the information gets to the

Client side, it will be only the actual included info/detail.

Now, I'm going to back what is stated in the documentation again. The

included must be relative to the document being analyzed. In this case
the

document being analyzed is the html file you sent via SEND HTML FILE.

I can see that it works as you stated for 2004 (tested in 2004.7
Build3).

However, the behavior in 2004 seems to go against what is stated in the

language reference (http://www.4d.com/docs/CMU/CMU02070.HTM).

You are right. 4DINCLUDE is not complicated at all. What we discussing
here

is a matter of which is the correct behavior.

Regards,

Add K.

On 11/19/08 6:22 PM, "Justin Leavens" <jleavens@... wrote:

That would be a bit strange, because then we're heading into that area

where 4D would be sending files outside of the HTML root folder, which

is what David was just saying was so dangerous. Also, since the two

folders are at the same level, this should have worked:

<!--#4DINCLUDE ../includes/debug.shtm-->

Again, just to be clear...

I am using SEND HTML FILE to send this document:

/application/mywebdocs/doc.shtm

That document includes a <!--#4DINCLUDE debug.shtm--> and there is a

file in the directory:

/application/4dhtmlroot/debug.shtm

I can access debug.shtm at the URL: http://www.myapp.com/debug.shtm

But my <!--#4DINCLUDE debug.shtm--> tag always gets parsed to:

<!--4DINCLUDE debug.shtm--> : The document cannot be opened.

4DINCLUDE is not a complicated tag: Other than requiring you to

specify a document within the 4D HTML Root directory, there's not much

to it. These includes worked just fine in 4D 2004 in this same

organization.

Reply to this message

Summary created 11/20/08 at 2:03AM by Intellex Corporation

Comments welcome at: feedback@intellexcorp.com