What i've missed if my filesystem collection returns nothing? #882
-
Hello, Johan!
Also I have
But when I browse So, what I've missed? I've read the whole documentation. Sure my understanding now is just like I am a newbie, but here I tried to combine two of your examples: Filesystem-Collection and Cookbook-Articles. On the other hand I get expected 2 titles output if I replace the code above by this one:
But I can't use this (2-nd) way because then I miss filenames that I need later to transliterate and set up routes somehow for each particular article. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The Filesystem collection is build to work with a single file containing structured data. For example; a json file, or an ini file. It's not build to work on a folder. The term The Data API and the Collection API are two different API's that are build for different purposes. The Data API is primarily intended to work with static structured data files. Often there are smaller pieces of unrelated data you need to render on a site that doesn't belong anywhere, you could hardcode that data in the html but that makes it hard to change them, so thats where the Data API comes in. You should however not use this API for your main content, that's what collections are for. You could solve the problem in 2 ways:
For your use-case 2 makes the most sense, since you also need to integrate additional features like the handling of the slugs based on the filenames etc. To get an idea how to build a Pages extension you can check: https://github.com/joomlatools/joomlatools-pages/tree/master/contrib/extensions |
Beta Was this translation helpful? Give feedback.
The Filesystem collection is build to work with a single file containing structured data. For example; a json file, or an ini file. It's not build to work on a folder. The term
filesystem
denotes the data source, the data comes from the filesystem...The Data API and the Collection API are two different API's that are build for different purposes. The Data API is primarily intended to work with static structured data files. Often there are smaller pieces of unrelated data you need to render on a site that doesn't belong anywhere, you could hardcode that data in the html but that makes it hard to change them, so thats where the Data API comes in. You should however not use this API for you…