Use same infolist as page and modal when needed?
I have a resource with a view page infolist. I also want to add an Action in some other panel that would just open a peek infolist modal from that resource, rather than going to the page or having to copy paste the infolist in the action
how can i achieve this?
4 Replies
Have a look at the code of the ViewAction. It's basically what you need, just without the switch for Page vs. Modal.
Thank you, this seems to be what I'm looking for. But how do you properly reference the record from an outside resource?
Currently I have this, which is outside the review resource,
Where do you use that code? I think the actions have a
->record()
method to pass in the record.
But u thought you wanted the modal? You don’t need to use a whole action just for a linkI am using it inside the AppServiceProvider, to extend the Ralph Media plugin
Basically trying to add a button on each image in the media page, that will quickly open a view modal of it's parent Review, so you can see where each image is used.