-
-
Notifications
You must be signed in to change notification settings - Fork 495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
collection.getFilteredByTag is not a function when populating collection via API #1153
Comments
I have managed to fix this issue by simply adding
However I would still like to know if collection methods will be available if it is getting populated via an API. |
I think you’ve misunderstood the argument there. I’ve changed the docs to reflect this but it’s more accurate to read it like this:
So what you’re doing there is effectively monkey patching the collections API, which is probably not what you want. Now, you can return any arbitrary object from your collection but we don’t modify those in any way. https://www.11ty.dev/docs/collections/#return-values All of that being said, I don’t think collections are the right mechanism here. JavaScript Data Files will probably work much better https://www.11ty.dev/docs/data-js/ |
|
Describe the bug
I am trying to implement the solution for previous and next links on my project (#529). My collections are getting populated via an async API call.
After the collection is populated, I am trying to call the function
getFilteredByTag
but it fails with the errorgetFilteredByTag is not a function
. I may be doing something wrong but can you help identify what could be going wrong in this case?Screenshots
Environment:
Additional context
Below is the collection method that I am utilizing to bring data from my ghost installation.
The text was updated successfully, but these errors were encountered: