stefanjudis / sketch-contentful

A Sketch App plugin to populate your documents with data stored in Contentful.
MIT License
28 stars 2 forks source link

Some fields populate, some don't #3

Open mss4aa opened 7 years ago

mss4aa commented 7 years ago

OK, I was able to get some of the fields to populate in Sketch! Huzzah.

I have some that would not. Here is the ID of each one: instructions ingredients categories heroImage (this is a Media content type, not sure if that's supposed to work or not :)

Fields that DO work: title (a Short Text content type) shortDescription (a Long Text content type)

Let me know if you need any more info. Thanks!!

stefanjudis commented 7 years ago

Okay... At least a tiny success. 😊

Can you show me the content type in the Contentful web app and the layers in sketch? Then I can build something similar and check what's going on.

What does the bubble on the document say?

Thanks.

mss4aa commented 7 years ago

Sure. The bubble does not show up. (It did show up the first time, when I successfully imported data for the "title" field.)

Here are screenshots of a) the Sketch fields (I blocked out the site ID to keep the client's data private) and b) the content types in Contentful.

The Sketch fields look a little odd because I grabbed a random sitemap document and started adding field names to existing content.

Let me know if there's anything else you need.

contentful3 contentful2
stefanjudis commented 7 years ago

There is still error handling missing... I will have a look at this case. :) thanks.

But the main problem here is, that you're dealing with references instead of text fields (e.g. Ingredients and Categories).

There can be one or more connected entries then can have several text fields on its own.

What did you expect to happen when you put {fields.ingredients} in the layer?

mss4aa commented 7 years ago

Since I wasn't looking at the content type when I entered it, I forgot it was a reference. I guess that means I expected it to pull whatever content it was referencing.

I believe there are other non-reference fields that did not function. I'm on my phone so I will take a look shortly.

Thanks!

On Jan 26, 2017 8:03 AM, "Stefan Judis" notifications@github.com wrote:

There is still error handling missing... I will have a look at this case. :) thanks.

But the main problem here is, that you're dealing with references instead of text fields (e.g. Ingredients and Categories).

There can be one or more connected entries then can have several text fields on its own.

What did you expect to happen when you put {fields.ingrededients} in the layer?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/stefanjudis/sketch-contentful/issues/3#issuecomment-275383195, or mute the thread https://github.com/notifications/unsubscribe-auth/AU7-UZ5P_lZryb1O7JnGxaE_W2tZDQ9vks5rWJmIgaJpZM4LuAOP .

stefanjudis commented 7 years ago

I believe there are other non-reference fields that did not function. I'm on my phone so I will take a look shortly.

I'm pretty sure that this then was a follow up after the reference error. :)

It would be great when we could brainstorm how to proceed with references and what would make most sense for a user.

mss4aa commented 7 years ago

OK interesting. I think for a user, the ideal case is if the API call could somehow grab the referenced content. Otherwise the designer would need to link each referenced item (in this case, each ingredient) to its own content ID.

This causes problems when, let's say the content manager removes and adds ingredients (to/from a recipe) in Contentful. The API would not know this, and would continue pulling the same content based on the ID listed in Sketch.

Is it even possible for this API call to pull in nested content IDs?

stefanjudis commented 7 years ago

Is it even possible for this API call to pull in nested content IDs?

Jap, that's possible. So let's assume we have the following content model.

                     Foo
---------------    / 
| ingredients |----
---------------    \
                     Bar

The number of ingredients is flexible in this case.

I'm not sure if the naming of layers is an approach that works really well for this scenario. I feel like that what sketch users want to do is set a blue print and then automatically add the blueprint to the sketch document for every reference entry fetched from contentful. If references have been deleted the connected layers should disappear also.

Am I right with assumption?

I'm really not sure how to tackle this, because I think it becomes hard to understand really quickly.

We could probably also just connect layers to references like this

- fields.ingredients[0].fields.title
- fields.ingredients[1].fields.title
- fields.ingredients[2].fields.title

But this is also nothing that scales really well nor is nice to work with.

mss4aa commented 7 years ago

I've passed this question along to a designer co-worker (I'm just the content strategist, lol) because I have limited Sketch knowledge. I'll let you know what he says!

On Thu, Jan 26, 2017 at 9:32 AM, Stefan Judis notifications@github.com wrote:

Is it even possible for this API call to pull in nested content IDs?

Jap, that's possible. So let's assume we have the following content model.

                 Foo

--------------- / | ingredients |---- --------------- \ Bar

The number of ingredients is flexible in this case.

I'm not sure if the naming of layers is an approach that works really well for this scenario. I feel like that what sketch users want to do is set a blue print and then automatically add the blueprint to the sketch document for every reference entry fetched from contentful. If references have been deleted the connected layers should disappear also.

Am I right with assumption?

I'm really not sure how to tackle this, because I think it becomes hard to understand really quickly.

We could probably also just connect layers to references like this

  • fields.ingredients[0].fields.title
  • fields.ingredients[1].fields.title
  • fields.ingredients[2].fields.title

But this is also nothing that scales really well nor is nice to work with.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/stefanjudis/sketch-contentful/issues/3#issuecomment-275402063, or mute the thread https://github.com/notifications/unsubscribe-auth/AU7-UR1FOlg68dzeYjJuFiMBlF0C19tTks5rWK6NgaJpZM4LuAOP .

-- Melanie Seibert Senior Content Strategist WillowTree, Inc.® willowtreeapps.com

stefanjudis commented 7 years ago

That's awesome. Thanks Melanie!

stefanjudis commented 7 years ago

@mss4aa I added error messages which will tell you at least when something went wrong.

mss4aa commented 7 years ago

OK thanks! I'll bug my designer friend again and try to get more answers to your questions.

On Tue, Jan 31, 2017 at 9:33 AM, Stefan Judis notifications@github.com wrote:

@mss4aa https://github.com/mss4aa I added error messages which will tell you at least when something went wrong.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/stefanjudis/sketch-contentful/issues/3#issuecomment-276378703, or mute the thread https://github.com/notifications/unsubscribe-auth/AU7-UYWbbixgd_Ww174F8_sqipUUjPzEks5rX0ZNgaJpZM4LuAOP .

-- Melanie Seibert Senior Content Strategist WillowTree, Inc.® willowtreeapps.com

mss4aa commented 7 years ago

I talked to my designer friend and he's busy this week but he wants to take a look next week and hopefully give you some designer input!

He did say it would be awesome if Sketch could write data back to Contentful...

On Tue, Jan 31, 2017 at 9:44 AM, Melanie Seibert < melanie.seibert@willowtreeapps.com> wrote:

OK thanks! I'll bug my designer friend again and try to get more answers to your questions.

On Tue, Jan 31, 2017 at 9:33 AM, Stefan Judis notifications@github.com wrote:

@mss4aa https://github.com/mss4aa I added error messages which will tell you at least when something went wrong.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/stefanjudis/sketch-contentful/issues/3#issuecomment-276378703, or mute the thread https://github.com/notifications/unsubscribe-auth/AU7-UYWbbixgd_Ww174F8_sqipUUjPzEks5rX0ZNgaJpZM4LuAOP .

-- Melanie Seibert Senior Content Strategist WillowTree, Inc.® willowtreeapps.com

-- Melanie Seibert Senior Content Strategist WillowTree, Inc.® willowtreeapps.com