Anvil Community Forum

Navigation sub links

I have created an app that has a component in tended to be used in a navigation bar. It has a link and a linear panel with links. The project is based on Hover, Focus Dependency from @sc549. The sub links appear when you hover over the section heading but disappear when you are not hovering over either the section heading or the sub links.

When I go to use this app as a dependency in another app, it fails because the app with the navigation links does not have access to the forms in the main project. Is there a work around to give the dependent project access to the main project’s forms?

Here is the project with the navigation sub links
https://anvil.works/build#clone:TGUMNIO6R732FRQ2=RX2MREKZRROA6TCS36Z6ZFLW

Here is a project demonstrating the problem.
https://anvil.works/build#clone:3DGNEQV6I6LJA3HF=D6XIB3UE75P3VJV6VFCTK3UK

1 Like

Hello,

I’m trying to take a look but I can’t see where self.linktitles is defined in the dependency (on the form “sideBarLinkSection”).

Could you let me know the exact error you are getting so that folks can narrow down the issue a bit better?

In my testing if I use 'Form1', 'Form2', and 'Form3' (the form names on the main app) as self.linktitles everything seems to work. Does that help at all?

self.linktitles is a property of the sideBarLinkSection component in the sideBarLinks project. Yours does seem to work… And you didn’t change anything?

Here is a screen shot of the error.

Okay great that makes sense.

In the IDE under linktitles, I assume you would just type in Form1 , Form2 , and Form3. As follows:

sc

I did that and it works for me.

In your main app, do you have a form called “form2” (exactly case matching)? I would imagine that the items in linktitles have to match your form names exactly.

2 Likes

Thanks. Is funny how sometimes programming 101 mistakes can be bigger that the more complicated problems.

2 Likes

Hi Campopianoa,

Can you please share the project solution file to this problem.

Thanks

@adam.willis007 Here is my updated project.
https://anvil.works/build#clone:TGUMNIO6R732FRQ2=RX2MREKZRROA6TCS36Z6ZFLW

The timing could be refined, but it is functional. You could make this project a dependency of this one.

1 Like

Thanks very much,

New to Anvil but enjoying it thus far.

1 Like

I have only been using it for a few months, but I really like it too. I hope that helps.

1 Like