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

What is Framer? Join the Community
Return to index
Naema Baskanderi
Posted Feb 05 - Read on Facebook

Nested Layers Question

Hi All,
This may be a silly question.
(I did look through the group to find info on how to access nested layers)

I was curious about accessing nested layers from an imported sketch file where there are duplicate names It seems as though I have to name each layer. Here is an example of what I mean:

pwdInputField = Navigation.subLayers[0].subLayers[1].subLayers[0]
emailInputField = Navigation.subLayers[0].subLayers[2].subLayers[0]

I was just wondering if there is a *smarter* way of doing this :)

2 Comments

Mike Johnson

When you import nested groups are actually all namespaced directly on the import object.

In your case `pwdInputField = Navigation.yourGroupNameFromSketch`

Andreas Wahlström

Here's a plugin I wrote that should help with situations like this: https://github.com/awt2542/Select-for-Framer

In this case you'd use SelectOne('Password > InputField') and SelectOne('Email > InputField'). If you'd like to do this without a plugin you could try Navigation.password.subLayersByName('InputField')[0]. The plugin handles a lot of other cases too, though.

Read the entire post on Facebook