You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the home page, I have two ContentListcomponents:
one should (if I understand correctly) show all the docs in the content/articles directory but it shows only the document at that specific route
one shows only the documents because I have specified a path prop with an empty string (if I remove the prop it does not show any content).
Describe the bug
My understanding of ContentList from the default example in the doc, is that it should fetch all the documents that are at the root of a directory but it only fetches the one document specified by the path prop (like it does for ContentDoc, which makes sense for ContentDoc but not really for ContentList)
Also when we don't use the path prop it does not fetch any single document.
The only way I have found to fetch several documents is to specify path="" with an empty string but that does not seems like normal.
Please note that I am a newbie and that the root cause of the issue might be me :-)
The text was updated successfully, but these errors were encountered:
Ah excellent! I was just banging my head against this. Good to know I'm not alone 😄
It seems that ContentQuery isn't quite working as I would expect. Unless I'm missing something (or we both are) this should allow you to query a content folder but it behaves a little strangely at present.
From my testing if you query a folder full of content (I have been testing with MD files) it will show as empty when using a content query. Adding an index.md file will then list there is one page in that directory with no children or any indication there may be other files present in that directory.
There seems to be a prop on ContentQuery called find which if set to surround ends up with some nulls being returned.
I've been reading through the src and I can't see what might be going wrong.