-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Automatically inject the associatedfiles array into the document object #7
Comments
We actually did this in early versions of the plugin, however dumping meta or template data in pre-emptively, rather than as requested, caused memory issues. The standard since, has been plugins should expose data via template helpers instead. We just need to update plugins to do this from now on. E.g. the feedr plugin should instead of doing |
🔒 |
@balupton How does one retrieve the associated files from a Collection? I've set up a Paged collection using the Paged plugin, but it doesn't load a DocumentModel.
getAssociatedFiles is not defined. |
The problem here is the
|
@balupton - I'm so glad to find your answer here, as I've been searching out this problem for hours, but I still must be doing something wrong. This doesn't seem to be solving the problem for me. If I try the most basic query:
I get.
Nonetheless, it appears it's getting the exact number of objects that it should. If I call toJSON() on the collection then the iterated object appears to be functional otherwise, but I of course can't call any methods on it. If I don't call toJSON() on the collection then it appears very confused as to the objects model -- it will not allow me to access .title or any field or call any methods on 'undefined' but iterates the right amount of times. Is there a definition for DocumentModel that I need to pull in, perhaps -- I am doing this from within a document. (I am new to Javascript/json/node -- my apologies if I am missing some obvious convention). |
Try this |
Works beautifully, thanks... now that I've got my debugger working too it's a lot easier to find out object prototypes so that I can look up documentation as needed, too... it's been frustrating as there are a lot of patterns/conventions/etc that I'm just not aware of and don't know what dependencies documentation to look in. The documentation for docpad could use a little bit more improvement, though the little getting started guide is one of the better ones I've read for a framework... Thanks for your help! |
Have the associated files automatically load and be available rather than having to call getAssociatedFiles().
The text was updated successfully, but these errors were encountered: