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

What is Framer? Join the Community
Return to index
Baisampayan Saha
Posted Aug 30 - Read on Facebook

I have made a gallery component which I want to add to a layer as a child. for example:

{Gallery} = require "Gallery"

layer = new Layer

galleryComponent = new Gallery
parent: layer

this doesnot seem to work. Is there a way to append component from modules to be added to other layers as child?


Floris Verloop

This really depends on how you've set up your module. Any change you can share it?

Baisampayan Saha

Floris Verloop please find the prototype below...I want this to add to a page check..i have created a layer and tried to make the layer a superlayer of the component created by the module...biut could not do so....

Floris Verloop

In your module, you're not assigning parents to the "image" and "imageLayer" layers.

Mind that when you extend your class from "Layer", the class itself will behave as a layer when imported in Framer. You need to add the "image" and "imageLayer" as children to the class itself by doing "parent: @".

When you now set the parent property on your imported gallery layer in, the other layers also move to the assigned parent.

I've updated your module to make this work, but all the positioning is off, because the layers become relative to the parent (Gallery) layer:

Baisampayan Saha

Floris Verloop thank you for the help. Let me go through the code...

Read the entire post on Facebook