Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Showing Records on Home.xsl

Featured Replies

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.

  • Author

I want to clarify what I originally posted.

I just want to know how to simply have one file (in this case home.xsl) display a found set.

I have a layout with only one field. I want to display all the records where that one field is not empty.

It should be simple to do.


 

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



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.

  • Author

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?

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"?>

  • Author

Thank you, I got it working.

If anyone is interested, this is the site:

http://fpas.neenah.k12.wi.us/fmi/xsl/stockroom/home.xsl

Almost does what I want. I did a query for "New Item". I couldn't get the query to search for non-blank items. Anyway, it is good enough as it is.

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...

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.