dataliterate / data-populator

A plugin for Sketch and Adobe XD to populate your design mockups with meaningful data. Goodbye Lorem Ipsum. Hello JSON.
MIT License
1.67k stars 113 forks source link

Data population of overrides in symbols (new in Sketch 3.7) #52

Closed sweeting closed 8 years ago

sweeting commented 8 years ago

With the introduction of symbol overrides in Sketch 3.7 (currently in beta), it would be great to be able to populate overrides with JSON data.

Sketch 3.7 symbol overrides in action: https://twitter.com/tmgrhm/status/714864050493005824

nitrada commented 8 years ago

We're investigating.

nitrada commented 8 years ago

@sweeting we're still having several issues, but you can check this out: https://github.com/preciousforever/sketch-data-populator/releases/tag/v1.6-beta.1

skipjack commented 7 years ago

I'm not sure if my issue is the same as the one described here as it looks like that twitter account is protected... if it's not I'd be happy to create a new issue. I'll leave this one closed and wait for advice for a bit before doing anything else.

I was wondering if something like this is possible:

image

It would be great if this plugin could override the placeholder override. I've just started playing around with this plugin so maybe I'm missing something or approaching this in the wrong way but I'm seeing a few issues with using it to populate data within symbols (and nested symbols).

nitrada commented 7 years ago

@skipjack have you tried using {name} in the content of the layer inside the symbol? Like this, the placeholders always remain unpopulated and the populated data is just in the overrides.

skipjack commented 7 years ago

@nitrada thanks for the quick response! Yes that does work however the symbols I'm trying to populate are broadly used and thus would not have the same {placeholder} data in every instance.

So detaching them and doing what you mentioned works, but then I lose out on updates to those common symbols.

nitrada commented 7 years ago

@skipjack you don't need to detach them. They can have different data in each instance although they have the same placeholder in the symbol!

skipjack commented 7 years ago

@nitrada Sorry I think I should have mentioned these are overrides within nested symbols. Also, I meant they wouldn't necessarily be pulling from the same key within the JSON data. I can try to put together a demo if that would be helpful.

Related side note: Are there any good videos or tutorials you could point me towards that go through using this plugin for symbols and nested symbols? I was looking through the readme but couldn't find much on symbols except for the swapSymbol directive.

nitrada commented 7 years ago

@skipjack sorry, no video tutorials. but have you checked the demo.sketch?

what about creating different nested symbols, each with their own data key {placeholder}? you could then use swapSymbol to change them driven by data…

nitrada commented 7 years ago

(regarding the feature you mentioned earlier: would be great if you coud open a new issue as a feature request. demo would be helpful, too!)

skipjack commented 7 years ago

@nitrada sounds good, I'll...

Thanks again!