Skip links

FileMaker 12 and CSS: Instructions and first experiences (Update)

FileMaker training, courses, coaching

Custom layout designs with FileMaker 12 and CSSOne of the new features in FileMaker Pro 12 is the new layout design architecture. Developers have 40 new standard designs at their disposal, which already include buttons with attractive mouse-over effects, fields with rounded edges, objects with shadows or background patterns.

As a graphic artist and designer, the new display options are very welcome. FileMaker is finally using modern technology here and saying goodbye to the ballast of the outdated old layout engine, even if this is associated with an unpleasant file format change. But if you take a closer look, you realize that many parameters of an assigned layout design cannot be reached with on-board tools...

Create your own layout designs?

As you may already know, the new display format in FileMaker Pro 12 is based on so-called "Cascading Style Sheets", or CSS for short. These are a structured descriptive language for content and ensure the look and feel of almost every modern website.

As the CSS is also available in text form in FileMaker, it is very tempting to create your own designs. We have taken a look at whether this is possible and what you need to bear in mind.

Where are the CSS stored?

Under Windows 7, the 40 standard themes are located as individual folders in "Themes" in the "FileMaker Pro 12 Advanced" directory, where the executable FileMaker program is also stored.

On the Mac, we must first display the package contents by right-clicking (or ctrl-clicking) on the "FileMaker Pro Advanced" program and then find a folder called "Themes" in the "Contents:Resources" folder. If we take a closer look at the "cosmos" theme contained in this folder as an example, the following files can be found in the folder of the same name:

  • cosmos.css (contains the actual format definitions of the design template)
  • cosmos_ja.css, cosmos_sc.css, cosmos_tc.css (contain font changes for Japanese and Chinese systems)
  • the "images" folder (contains all images used in CSS and the preview image "cosmosPreview.jpg", which is displayed in FileMaker during design selection)
  • manifest.xml (contains, among other things, the ID of the design, the name and the group designation)
  • manifest_en.xml, etc (contains the German name and group name, or for the respective installed language pack)

Can I change the CSS or how can I create my own designs?

First of all, I would like to say that this is not officially supported by FileMaker Inc. at the moment, nor is there any documentation available. Furthermore, before you start creating your own designs, you should have already dealt with CSS or read up on the subject beforehand.

Of course, it is also essential to observe the "FMPA License (German).pdf" (to be found in the "FileMaker Pro 12 Advanced" folder), which does not allow you to modify the program itself.

On the Mac, however, we do not have to modify the program resources at all:

We can also store our own designs in the "Application Support/FileMaker/Extensions/Themes" folder. These are recognized by the FileMaker program and displayed with the standard themes in the overview.

Customize a theme

For testing, we copy any design folder into the "Application Support/FileMaker/Extensions/Themes" directory and rename it "Example".

In manifest.xml we have to make the following adjustments:

Element "ID": 

at.karo.theme.example01

Here we have to assign a new unique ID - the CSS and images are stored internally in FileMaker under this ID. More on this later.

Name" and "Group" elements: 

Example
karo

These two elements must also be included in the manifest_en.xml be adapted in the same way.

example.css

This must contain the name of the file that contains the CSS for our new design.

images/examplePreview.png

If we have created a preview image, the path to it is entered here. A preview image should be 736 x 612 pixels in size. The style sheets for the new appearance can then be adapted in the example.css file.

How do the new style sheets get into a FileMaker file?

The newly created design appears in the selection dialogAs soon as we have created our own design, it is already ready for FileMaker. It is not necessary to restart FileMaker. By calling up the dialog to select the design, all available CSS designs are loaded and displayed. If I assign a design to my layout for the first time and it has never been used in this FileMaker file before, all CSS and images are copied from it to the FileMaker file and stored under the ID that was specified in manifest.xml.

However, as soon as I assign the same design to another layout, only this saved CSS is referenced and no new definitions are added to the file.

The FileMaker file does not forget...

However, this brings us to the problematic part: If a design has been assigned to a layout in a FileMaker file even once, all information (CSS descriptions and associated images) remains stored in this file. If new designs are assigned to the layouts, the old obsolete designs remain in the file, even if not a single layout uses them. No compressed saving, cloning or restoring of the FileMaker file can remove them!

And this behavior also applies to standard designs and is easy to demonstrate:

We create an empty file without tables or fields. This initially has just under 90 KB. If we now assign all available standard designs to a layout one after the other (even without creating a new layout), the file ends up with 3.4 MB - just filled up with all CSS themes used so far.

How can I update my own design (updated on April 17, 2012)

As FileMaker always accesses the CSS stored in the FileMaker file first, subsequent format changes in the CSS file in the "Themes" folder (here example.css) will not take effect even if you reassign it to a FileMaker layout.

When we first published this article, we were only able to apply changes by changing the ID in manifest.xml and thus bringing a "new" design into the file. However, this approach had a serious disadvantage: the old set of CSS formatting was NOT removed. The file continued to grow with every change to the ID - CSS information and images were also stored multiple times. If we selected an old ID that had already been assigned, the style sheets stored in the FileMaker file were accessed again...

But as has now become known, there is a much simpler way: If you hold the cmd-alt-ctrl-shift keys before pressing the OK button when selecting a self-designed FileMaker design, the CSS data of the selected design is reloaded into the file by FileMaker. Previously made formatting changes are immediately visible on the layout.

This method also reloads all images referenced in this design and removes the old CSS information and images no longer required under this ID from the FileMaker file.

Recommendations for practice

As the above-mentioned circumstances of the assignment also apply to the standard designs, we should never use a "live file" for testing, but design and test in an extra file. Once the appearance is fixed there, we can simply copy all elements to our solution file via the clipboard and copy styles there using the inspector (in the "Appearance" tab) and apply them to other objects.

However, it should be noted that there are formatting options that are not described via objects, but only become effective by assigning a design: This applies, for example, to shadows or background patterns such as those found in the standard "Bamboo" design.

I would also like to briefly mention an alternative approach to the topic here: If we examine the stored information of a clipboard of a FileMaker layout object, as is possible for example with the Clip Manager of myFMbutler, we find the entry in the XML code with an extensive CSS description of the previously copied layout object. Here, too, the clipboard can be manipulated to influence the formatting as desired.

Conclusion

As we can see from the examples shown above, using your own designs is not without its problems.

Of course, there is a great wish that FileMaker will provide a CSS editor in one of the next versions and, above all, support the cleaning up of old obsolete designs in a file. We will be surprised to see what else will come...

Author: karo productions, owner Robert Kaiser - Parkgasse 7, A-2105 Oberrohrbach

Leave a comment

  1. Hello Robert,

    I have tried this under FileMaker 13 as indicated but unfortunately somehow failed...

    If you hold the cmd-alt-ctrl-shift keys before pressing the OK button when selecting a self-designed FileMaker design, the CSS data of the selected design is reloaded into the file by FileMaker. Previously made formatting changes are immediately visible on the layout.

    Is this no longer possible with FileMaker 13 or what am I doing wrong?

    lg

    Olli

    1. Hi Olli, after FileMaker Inc. spoke out against this approach back in 2012, I no longer pursued this option.
      If I still have to make modifications (at my own risk of course ;-) then only via the XML code of the clipboard. This is possible, for example, with the ClipManager from FMButler.
      lg karo

Share this page:

ERP software as flexible as your company.
We will be happy to advise you.

Customizable ERP software for Mac, Windows and iOS.

You are here: FileMaker 12: Custom layout designs with CSS.