Jump to content

Showing Records on Home.xsl


Bryan VonDeylen

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

Recommended Posts

Used the FileMaker Site Assistant, I created a web site which gives you the typical files (home.xsl, recordlist.xsl, browserecord.xsl, etc).

I want to modify the home.xsl file so that beside taking you to the findrecords.xsl and recordlist.xsl it will also display all new records added in the last 30 days (it is a stock catalog).

I have added all the

I would like the home.xsl to display all the records in the table where a field is NOT blank, but I can't get it to perform that function.

Not sure what I need to do. Somehow the home.xsl needs to look up the information in the table, and I am guessing, store that in the @fetch and @fetch-size?

I would like to do this all in one file, instead of creating links that will find all the data and then display it.

Link to comment
Share on other sites

You need to do that in two steps:

First, you load the content in a variable with the XSLT document() function:








Make sure that in the database you assign a name/password combination to your fmxml extended privilege set. Otherwise you run into danger that the complete database can be read out if the Guest account is assigned to fmxml.



Later, you can use the variable as you like, e.g. like this:





  do something here



Link to comment
Share on other sites

You can run a separate request as Martin suggested, but in your situation it could be simpler to embed the whole query in the xslt-cwp-query-param instruction. That is in addition to -db and -lay you can also add the required field= and field.op.xxx parameters and the -find command.

If the find you need is difficult to run, for example, if you want to embed the current date somehow -- I doubt this is possible for the query-param statement -- you can perform the final find using the -script= or -script.presort= instructions; in this case the command may be -findall (or -find, or -findany, this doesn't matter, because the found set will be changed, but -findall is less ambiguous).

Since all the parameters are embedded, the URL will be simply "home.xsl" or "index.xsl", i.e. same as it is now.

Link to comment
Share on other sites

Can you give me an example of this. This sounds like what I want.

The field I am doing a find on is NOT a date field. I just want to find all records in a table where a Text field is not empty.

So, lets say the database is called "stockroom"

The layout is called "web_find"

The field is called "alert"

How would the cwp-query be structured and then presented within only one file?

Link to comment
Share on other sites

Mikhail is right and it can be done this way; my suggestion is more flexible because the query can be dynamic (i.e. variables can be passed to it).

Everything you need to construct the query is in the FMSA CWP Guide, Appendix A, and on page 55.

In your case, the query would look like:

<?xslt-cwp-query params="–db=stockroom&–lay=web_find&–grammar=fmresultset&alert.op=bw&alert=*&-max=all&–find"?>

This you set right after the first line, <?xml version="1.0" encoding="UTF-8"?>

Link to comment
Share on other sites

The query to search for non-blank items must copy the FileMaker way to do this. The latter is to use the asterisk symbol (*) as a wildcard for "any value". To use these symbols in a web query, you must use the "bw" ("begins with") query operator. That is a query that searches for non-empty values in a "Sample" field must have the following commands:

...Sample=*&Sample.op=bw...

If you have a complex query, that is "non-empty Sample and ..." or "non-empty Sample or ...", use the "lop" operator. E.g.

...Sample=*&Sample.op=bw&Another Sample=Some Value&-lop=and...

Link to comment
Share on other sites

This topic is 6442 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.