DWilliames / google-sheets-sync-figma

82 stars 8 forks source link

Using the same value twice / multiple times? #240

Open clarklab opened 2 months ago

clarklab commented 2 months ago

Is your feature request related to a problem? Please describe. Is there a way to use the same value multiple times inside a single frame? Example: I've got a movie cover that shows the movie title in 3 different places. Each cover will be a different movie, but inside each cover I need to use the same title 3 times over. Is that possible?

Describe the solution you'd like Currently when I use the plugin, each instance of #Title gets a different title from the list. So a single movie cover gets 3 different movie titles added to it. Is there a way to "respect" the main frame as the parent and then repeat the data inside that parent? Basically I need the loop to run like this, only incrementing for a new parent frame:

Parent frame:

Title: A Christmas Story

Title: A Christmas Story

Title: A Christmas Story

Parent frame:

Title: A League of Their Own

Title: A League of Their Own

Title: A League of Their Own

Describe alternatives you've considered So far I haven't been able to think of a way to pull this off, without repeating data inside my spreadsheet, which seems like a bad idea.

Additional context I think this could come in handy in lots of other design scenarios. Picture something like a blog design, where often the same author is listed at the top and bottom of the article.

Any ideas? Or am I just reading the docs wrong?

clarklab commented 2 months ago

Doh! I missed the "hint" in this section of the docs, where it says I can name a frame with an appended .2 to lock the entire frame to that index.

The fix I just need to name each parent frame #Title.1, #Title.2, etc to make sure the context is locked, and that should be very easy to do with the Figma rename/increment tool.

clarklab commented 2 months ago

One more note on usage It doesn't seem like using .1 and .2 to specify index works with the @#naming convention for repeating layers/frames, unless I'm missing something. So you'll need to create frames inside your Figma file, use the CMD+R rename, and increment the frame names that way.

Then it worked perfectly!