Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 8310 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

You could use two format files:

#1 assigns [FMP-Field: includeName] to a token.

#2 uses [FMP-Include: {CurrentToken}]

The first format file uses:

code:


<body onload="Javascript:document.myform.submit();">

This auto-submits the first format file.

I use this type of auto-submit for return from '-edit' etc.

Hope this helps.

Garry

[ April 19, 2002, 01:05 PM: Message edited by: Garry Claridge ]

Posted

I have a result HTML page, it has a series of CDML conditional statements.

( you know [fmp-if: field: this .eq. that] Do this [fmp-else] Do that [/fmp-if] )

As a result, the rate at which the page loads seems to be be slowing down upon it's call. I realize this is due to the number of CDML conditional statements included on this page. Does anybody have an idea of how many conditional statements FileMaker will take without crashing?

I realize this is a far fetched request, but if I had a better idea I could help me decide if I have to completely redesign the backend of mywebsite.

Of course I am working on ways to limit the number of conditionals to speed up the loading of the page and prevent FileMaker from crashing everytime that page is called.

Anyone else reach the CDML limit on an HTML page? Any info would be appreciated.

Posted

This gets back to the original idea I had that doesn't work...

[fmp-include: [fmp-field: includeName]]

Where the field would contain the name of the file I want included.

it would be so cool if that worked... then I could replace about 25 conditional statements with one statement.

Then the changing data would be in the database record, where it belongs.

Posted

Thanks Gary, I appreciate the responses. I'm going to look into using the two format files. But I'm not interested in a delay with the linking... would that occur using the java script you suggested?

Posted

In reply to:

#2 uses [FMP-Include: {CurrentToken}]


This code doesn't work. The include option will not include a value from another tag. It seems logical to think that it would, but it doesn't. I now need to re-think the problem.

How can you include a changing format file based on a record value? - or any other value for that matter.

I have had to break it down into a series of conditionals...

[fmp-if: field: includeField .eq. "about"]

[fmp-include: about.html]

[/fmp-if]

[fmp-if: field: includeField .eq. "about"]

[fmp-include: about.html]

[/fmp-if]

[fmp-if: field: includeField .eq. "contactt"]

[fmp-include: contact.html]

[/fmp-if]

[fmp-if: field: includeField .eq. "History"]

[fmp-include: history.html]

[/fmp-if]

Where the inclusions automatically get inserted in the format file which has a series of standard design elements I don't want in multiple pages. The inlcusion file also have CDML in them so additional conditional statements will be made in the included file.

Anyone know how to do this?

Posted

Hi, That code looks like it should deliver CDML to the page properly.

Here's a very similar one that works for me in a record details page, the '.txt' files contain all of the alternative CDML code for the page:

<TD WIDTH=256>

<P>[FMP-IF: block.cn.am]

[FMP-INCLUDE: blank.txt][FMP-ELSE]

[FMP-INCLUDE: hoursam.txt]

[/FMP-IF]</P>

</TD>

<TD WIDTH=256>

<P>[FMP-IF: block.cn.pm]

[FMP-INCLUDE: blank.txt][FMP-ELSE]

[FMP-INCLUDE: hourspm.txt]

[/FMP-IF]</P>

</TD>

</TR>

<TR>

<TD WIDTH=256>

<P>[FMP-IF: availableam.eq.available]

[FMP-INCLUDE: am.txt][FMP-ELSE]

[FMP-INCLUDE: blank.txt]

[/FMP-IF][FMP-IF: blockam.eq.am]

[FMP-INCLUDE: am.txt][FMP-ELSE]

[FMP-INCLUDE: blank.txt]

[/FMP-IF]</P>

</TD>

<TD WIDTH=256>

<P>[FMP-IF: availablepm.eq.available]

[FMP-INCLUDE: pm.txt][FMP-ELSE]

[FMP-INCLUDE: blank.txt]

[/FMP-IF][FMP-IF: blockpm.eq.pm]

[FMP-INCLUDE: pm.txt][FMP-ELSE]

[FMP-INCLUDE: blank.txt]

[/FMP-IF]</P>

</TD>

and this one performs an 'if' for every line of a search return to change the font colour. It can have to do maybe 40 calculations to deliver the page, but the speed is OK:

<TD WIDTH=110 BGCOLOR="#[fmp-field:colourfield]">

<P><!--colour code here--><A HREF="javascript:openAWindow('[FMP-LinkRecID: format=record_detail.htm, layout=Layout1]','win2',375,300,0)"><FONT SIZE="-1" FACE="verdana,arial,geneva,sans-serif" [FMP-IF:status.cn.production]

COLOR="#999999"

[/FMP-IF]> <B>[FMP-FIELD: status]</B></FONT></A></P>

</TD>

for performance, I always store/index just about every field, especially calculations.

regards, Jeff

Posted

Jeff,

I realize your code works, but the question posed to this forum is can you dynamically change what's included based on a value in a field, cookie or token.

The token actually asigning the value of what's included.

Meaning, let's say you have 100 records in a database.

Each record has a few fields, one of which is "IncludeField"

I want to be able to do this.

[fmp-include: path/to/file/ [fmp-field: includeField]]

This code doesn't work of course, but think if it could. You could have 100 different possible inclusion in one line of CDML code.

Then the changing data would be in the database, where it belongs. The CDML wouldn't have to test 100 possible files.

The reason for this is I have a page which has a lot of CDML and I want to limit the amount of conditional statements on the page, by blindly including a file I know is there.

Does this make sense?

Posted

I believe that the ability to base an include on a field was possible with early versions of FMP 5.0 but was removed with a later patch update, due to security concerns.

Posted

You could try Javascript;

i.e.

<script language=javascript>

var inclde;

inclde = '[FMP-field:includefield]';

// then write out the html line:

document.write("[fmp-include: path/to/file/" + inclde + "]");

</script>

It might work - i haven't tried it - just guessing.

Lewis.

This topic is 8310 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.