I’ve ran into quite a challenge for me. I have user profiles on my site, generated by a template via a route, and each user profile has posts on it. The posts come in snippets, with page names like ‘user/post-name’. Each post snippet has an “Edit” button to change the post text.
I’m stuck at figuring out how to handle the post editing. When the “Edit” link (or in my case div) is clicked, an overlay with a form is displayed on the profile page. I have no idea how I could retrieve the post page details in order to display the text value in the form textarea.
Can this be done via the controller provided the edit button is not a form element which could submit stuff? Is there a way to use the data attributes on the Edit element?
Thanks for the tip, but I’ve been thinking about this and I’m not sure how to do it.
Since it’s the same URL pattern, how do you do it? Because you hit ‘profiles/user4321’, you hit Edit, an overlay is opened via jQuery and after you edit the content you hit ‘Save’, which is supposed to close the overlay. I’m also not sure how to retrieve the right page since the snippet looks something like this: