Phoenix LiveView (with Surface) partial page reload/update

Hi, I am wondering if it is possible to achieve behavior described below

I have a page that look something like this

[ Header ]
[aside][body]
[aside][body]

Where Header and Aside a static parts that don’t (their content) change at runtime.
Header contains logo and a search bar
Aside contains a navbar with links
I am trying to change the body when I click the aside bar link, but to also update the url. If I click to third link in aside navbar for ex: “/test-3” body shoud be updated with LiveView render containing some logical match for “test-3” and url has to be updated to “/test-3”.

Is this possible?

Thanks! :slight_smile:

Yes. This is what live_patch/2 do. See the doc:
https://hexdocs.pm/phoenix_live_view/live-navigation.html#content

1 Like

Okay this made me re-read docs and I realized how blind I was :sob:
Thanks :heart: