Possible issue with $site object and site.txt file

I have found some strange behaviour regarding the $site object and the site.txt file in Kirby 2.3.2, and also after update to 2.4.1

I have a multilingual setup, and stored some global parameters in the site.de.txt and site.en.txt files according instructions here

The files are located in \content, and operators like $site->title() pull the information from these files.

I’m doing some test with statistics, and placed another file statfile.de.txt down in \content, with a statement
Title: Statistics file German ----

Now, all global parameters gets pulled from the new statfile.de.txt rather than from site.de.txt
This works for all files that come “after” site.de.txt in alphabetical order, so if my other file is aaatest.de.txt, nothing happens.

Seems like the $site operator pulls information from the last alphabetical file in \content.

You can’t have additional .txt files in any folders, including /content, unless they are file meta data files.

If you need files for statistics or any other purposes, you have to create a separate folder within /content, use a different extension, or place that file somewhere else (if you don’t need to manipulate it via the Panel).

What is your use case for thestatfile.txt file?

Ok I will create another folder within \content for this.

Yes, I know there are statistics plugings. But I’m thinking of the following:

I have a lot of products in a tree structure. Everytime a product page is visited, I want to count using the $page->increment command to increment a field in the statfile.

On the start page then, I would like to show the “most wanted” or “most oftenly clicked” product. Don’t know how to do the calculation at the moment, but the first step will be the counting.

Just as an idea: Instead of using a separate statistics file, you could save that information in a field on the product page itself.