Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

How do I use linked documents? #79

Closed
ghelton opened this issue Dec 11, 2014 · 2 comments
Closed

How do I use linked documents? #79

ghelton opened this issue Dec 11, 2014 · 2 comments

Comments

@ghelton
Copy link

ghelton commented Dec 11, 2014

I'm trying to pull in some linked documents. I have working queries that provide me with Prismic Documents with linked documents available to me.

{
  fragments: {...},
  linkedDocuments: [...]
  ...
}

I was hoping there would be a method to select linked documents by Id or Name or some other property. I found this while looking for a solution: https://blog.prismic.io/U5nJQCwAAC4ABCJm/improve-your-content-discovery-similar-predicate-and-linked-documents

However the method near the bottom of the article (doc.getLinkedDocument) doesn't seem to exist in the Javascript SDK. If there aren't any features in the sdk to handle this I'll just move on to creating my own lookup, but I thought I would check.

@erwan
Copy link
Contributor

erwan commented Dec 11, 2014

Hi,

The signature differs depending on the kits, and in Javascript it is currently doc.linkedDocuments:
http://prismicio.github.io/javascript-kit/Doc.html

It is a member, not a method.

@erwan erwan closed this as completed Dec 11, 2014
@ghelton
Copy link
Author

ghelton commented Dec 17, 2014

if you find this sometime in the future, it's been changed:
https://qa.prismic.io/171/why-are-you-releasing-api-breaking-changes-in-the-javascript-kit-and-not-changing-the-major-version-number

Linked Documents are now accessible in the latest SDK as a method rather than a member.

Thanks for the update guys!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants