How can I force a modal to a view when a view page exists.
Hi, I have an action that links to a view page, but I'd also like to have a link to a preview page of that view page as a modal. I am using the following code:
The second View action works perfectly and links to the view page. But the first View action does not act as a modal and instead links directly to the view page. How can I get the preview link to work as a modal?
Solution:Jump to solution
As soon as you have a dedicated page, the ViewAction is configured to link to the page.
You need something like this:
```php
Action::make('preview')...
3 Replies
Don't use multiple
ViewAction
s. Your custom action should just be a normal Action.
Actions need unique names and you are defining view
2 times currentlyThanks, @Dennis Koch ,
I tried this:
I also tried this:
What I'm trying to do is generate an infolist as a slide over modal without losing having a dedicated view page that can be directly linked to.
Solution
As soon as you have a dedicated page, the ViewAction is configured to link to the page.
You need something like this: