It looks like you're new here. If you want to get involved, click one of these buttons!
Hi,
what would be the way to create a preview of a Simple Module entry only in the backend (best in a modal window)?
I tried to set the preview_path in my module to "/fuel/praemien/preview/{id}" and set up a preview() method in my model, but I guess that's the wrong place.
it should be also only accessible to logged in users.
Thanks for any hint.
Comments
I would setup your own controller and register a route (like normal CI). I would extend the Module.php controller so you get the authentication check.
If you are wanting to launch it in a modal window, you can use the fuel.modalWindow function in your custom javascript code that is meant to launch a modal window that contains an iframe:
Excerpt from custom_fields.js where it is used:
More on adding javascript to your modules can be found here:
http://docs.getfuelcms.com/general/javascript
Great! I was worrying about the auth check. I Will try that.
Thanks for your help!