Get path from page url not working

I have created a menu in bubble where according to the current page the corresponding menu text should get highlighted.
For this, when page is loaded, I’m using custom state to save the result of “Get path from page url”. For some reason, the result of this is showing empty. Can anyone explain why?

Right now, I’ve configured it to hide an element.

Below is the link to the editor:

That is because your page is not a path. Path is the bit after the page.

chatbot_setup/chatbot_setup will work in the way you intend.

oh…I got it.

But the page will always have that url. How do I add the path part to it?

Literally, add the path to the URL. Like, type it in. You can structure your own URLs.

(But why would you even structure a URL this way? /page_name/page_name makes no sense. So the question is, if you already have a page called /page_name, isn’t that what you wanted in the first place? Why are you jacking around with reading the path back? Just go to /page_name and be done with it.)

Sorry if I didn’t explain it correctly.

I am not concerned with how the page url looks, I need to extract page name or something else from the url so that the app knows which page the user is on and corresponding menu item gets highlighted.

If you know any other way of doing this let me know.

so dumb of me. I could just use “this url” or “current page name”.

Thanks for your time.

1 Like

Welllll… I think you’re missing a very fundamental point. There’s no such thing as “your app knowing what page the user is on.”

The page is either active or not. If no user is using the page, we do not care. And your app neither knows this nor doesn’t know this. Your app does not “know.”

If the user (be that user you, me, or the Googlebot) is on the page… The page will run. The page will not run otherwise. We do not need to detect this state.

When we design a page, we design it for a user we imagine using the page. If no user ever reaches the page, our imagination is for naught. But it does not matter.

Should a user get to the page, the page will execute. You are designing and programming your pages for this imagined situation. (Which of course you can test… by visiting the page yourself… as when you “Preview” the page.)

Now would be a good time, perhaps, to revisit the tutorial lessons.

https:bubble.is/lessons

@keith I have done the tutorials else I wouldn’t have been able to design and program all those pages :slight_smile:

I understand all that you are saying but I guess you are missing the point.

anyway, I have found a way to get the desired result. Thanks for your time.

This topic was automatically closed after 70 days. New replies are no longer allowed.