This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Logan Merriam
Posted Apr 03 - Read on Facebook

Super newbie coffeescript question: the framer docs show a loop to create new layers, but it looks like they all get the same layer name:

for number in [0...5]
pageContent = new Layer

How would I increment the name (i.e. "pageContent1", "pageContent2") so I can refer to them later? Bonus points: good way to print all existing layer names in a project so I can see what's happening.


Kevin Velasco

Clue: How is pageContent1, pageContent2 different from pageContent[1], pageContent[2]

Mike Feldstein

create an array with pages = [] and then say pages.push new Layer

Then you can access them at pages[0], pages[1] etc

Logan Merriam

of course! i was so focused on using "number". thanks guys!

Read the entire post on Facebook