-
Notifications
You must be signed in to change notification settings - Fork 35
Linked entries/assets not resolved on preview mode #103
Comments
Hey @martzoukos, Let me take a look into this, haven't experienced this issue before. Cheers |
Hey @martzoukos, Found the issue, you're using Hope that helps. Cheers |
Thanks David, so I need to do something like that?
|
with_preview(space: 'CONTENTFUL_SPACE', access_token: 'CONTENTFUL_ACCESS_TOKEN' ) do |preview|
@article = preview.entries('sys.id' => 'ENTRY_ID').first
end Cheers |
Ah, apologies. I should have looked here first. The object I'm fetching in this way, though, has a different schema than the content that's saved in my .yml files.
so I can then access it in my view as
When I switch to the Preview API, though, then I need to change my code to access the same property:
If I want to easily switch between production and preview mode in a view, this makes it very hard, if not impossible to access the properties in the same way. Is there any way to work around this? Thank you again. |
Hey @martzoukos, You can do Cheers Update: The PR has been created, you can follow up here: contentful/contentful.rb#112 |
Release Cheers |
Edit 16.12.2016: Apologies for the initial confusing title, I had a mixed up impression of what dynamic_entries do, the issue is the same but it has to do with linked entries/assets not being resolved, so please ignore what mention to dynamic_entries I make.
Hello there,
I'm using the
with_preview
method to preview a specific page that has linked assets and entries in some of its fields.While the nonlinked fields are working correctly, the ones where an asset or another entry is referenced, are not being fetched, for example:
I've snooped into the gem's code a bit and I saw that dynamic entries are set to :auto so this should be getting all the linked stuff.
Is this the intended behaviour? If not I can make a recursive method to fetch all the stuff, but I wanted to check first before I do it.
Thanks again!
The text was updated successfully, but these errors were encountered: