Nested linked elements?

The linked elements are great when using multiple instances of the same area on different pages or even on the same page. However, it would be nice to be able to nest linked elements, which is currently not possible.

Below is an example:

Component A and Component B are two different components, which in practice would also have different content, but should appear multiple times on different pages. However, both share the element AB, which should always be the same. So it would make sense to make element AB a linked element as well, which is unfortunately not possible at the moment.


(Div Profile Pic should be a linked element on it’s own but can’t because it’s parent is already linked.)

Could this be provided in a future version? What do you think?

1 Like

Nesting linked components would be a useful feature to have but there are a few complications. The main problem is it can lead to circular dependencies (a component is nested inside itself) and other issues that could potentially corrupt someone’s design.

If there is interest we could find some workarounds to make nesting possible, but for now it’s better to be on the safe side.

1 Like

I’m pretty sure you can tell if the current instance to be added is also a parent instance. This “problem” exists in any framework or program that works with symbols or components and can be catched just fine.

@martin

I just ran into an situation where I have a linked component that is present on all the pages of my site. Inside the linked component are a whole bunch of other components include a navbar, a few links, and a button that opens a modal that is also present on all 12 pages of the site.

My issues is that on five of the pages, I now need the button to open a different, unique modal on each of those five pages.

The only way I can see to do this is to unlink the parent component on those five pages so that the button is no longer linked. The downside is that now none of the other components in the parent component are no longer linked.

I’m wondering if there’s a way that we could have a linked component, but be able to specify one (or more) specific components within the linked component to be EXCLUDED from the linking? Would this possible?

1 Like

+1 I like the idea of being able to exclude items within a linked component.

@thedani

I think the issue is that there really “is” no parent. Since we can edit the component on any page and it will update all, there’s no way to really know which linked component was the parent unless you were to add some commented text to say so. Functionally they are all equal once they are linked.