Changing a menu button's position conditionally

I have a menu that drops down when a burger icon is clicked. There are 8 buttons in the menu including a button to view a User’s Venue. If a User doesn’t doesn’t own any Venues though, I make the “My Venue(s)” button invisible. This works fine. The thing is, there’s a Sign Out button below it on the screen so when the Venue Accounts button is invisible it leaves a gap in my menu. Is there way to conditionally position the Sign Out button so that the gap created by the hidden “My Venue(s)” button isn’t visible? I’ve tried a condition whereby if the “My Venue(s)” button isn’t visible, is sets the bottom margin of the Sign Out button so that that button moves up but this has no effect.

Here’s the menu when the Current User owns a Venue…

Screenshot_20230105_115436

Here it is when the Current User doesn’t own any venues…

Screenshot_20230105_115356

This is my condition to try to move the Sign out button up to fill in the blank and which doesn’t do anything…

Can anyone help me achieve this? I’d be so grateful for any help.

Many thanks in advance,
Joe

Hi there, @joefarrowsmith… have you tried setting the My Venue(s) button to collapse when hidden (which is the right or at least easiest way to do what you are trying to do) by checking the Collapse when hidden checkbox on the button’s Layout tab? If you don’t see that checkbox, it is because the parent container’s layout is fixed, and you would have to change that layout to something other than fixed in order to get the checkbox to show up.

Hope this helps.

Best…
Mike

1 Like

He’s done it again…Thank you so much, Mike!

Yes, it was set to “Fixed” so I set it to Align to Parent and repositioned the buttons with margins. Align to Parent gave me the “Collapse” option which I clicked. My condition then worked nicely.

Thanks again. This has enabled to make the next few steps of this app thing so much smoother.

Have a lovely afternoon!
All the best
Joe

1 Like

You don’t need a condition for this…

1 Like

Yup, just to be clear and like Adam said, you don’t need any condition once you check the collapse when hidden checkbox because that setting takes care of, well, collapsing an element when it is hidden. :slight_smile:

1 Like

I think I need to do some digging on my page for settings that are preventing this. Right now, if I don’t have the condition, I’m left with the space between buttons when logging in as a User who doesn’t own any venues. When I put the condition in, it moves the lower button up and takes out that space.

But what you say makes perfect sense and I’m fairly certain that it’s my page set up that is causing the problem as I haven’t checked it fully for “fixed” elements yet. I bet when I do I find some. I have to admit that “Responsiveness” is quite a big hurdle for me. I find updating pages to the nw responsive engine is a bit like detonating an explosive among all the objects and it’s a bit overwhelming finding things after pressing it so I have to steel myself first! I’ll get there!

Thank you very much for this input though, Adam. I really appreciate it.

All the best
Joe

1 Like