How to render the response of a live view to a specific container?

hi guys, I have divided the page into 3 sections, left, middle and right.
left has link, middle has main data, right miscellaneous data,
Now i have users in the middle section displayed as cards with a hyperlink to their profiles. Then i thought of a having quick view for profiles rather than redirecting the user to profile path.
i have used LiveView for the follow button. I believe i can use live view here and tried it but its not working at all, data is fetched by the page is not at all rendered. Can someone guide me here.
So the ask is
I click of the live link in cards from middle section

<a phx-click="quick_profile" phx-value-profile_id="<%= @profile_id%>"><a/>)

The profile details should display the rendered html in the right section.

Webpage design
| left section | Middle section | Right Section
| left section | user data profile link (live link) | rendered profile data(live)

Generally speaking, you should be using live_link. However, note live_link will only change the live view in the page that was defined in the router. So generally speaking, you would do something like this:

  1. Keep both left and middle section in the layout
  2. Define the right section as a LiveView in your router using the live macro

Now any live_link you click will change the right section LiveView.

Afaik, LiveView is not planning to focus on communications across LiveViews. We rather want the LiveView to represent the whole page and then use things like layouts and components to break it apart. That’s not to say communication across LiveViews are not possible. They definitely are if you name the entries yourselves and register them using Elixir’s Registry.

1 Like

:star_struck:, I got a reply from @josevalim, himself. Thanks @josevalim for this language and your work in ruby. I love both ruby and elixir. I appreciate your efforts. Thank you so much. :innocent:

I will try it and post here.

1 Like