blynx Posted August 31, 2016 Share Posted August 31, 2016 Hej, I am working on a Process Module which should display an html template in an iframe which I want to put through wirePopulateStringTags(). So I thought I'd set the src of the iframe to an executeIframe() function of that Process - but that would of course return the whole admin page. Is there a way to surpress the rendering of the admin interface and just send back the html file? I don't want to set up a page with a seperate template in the page-tree just for that feature. Otherwise I guess I'd make a helper php script ... Or does anyone have another idea? Cheers, Steffen Link to comment Share on other sites More sharing options...
Mike Rockett Posted August 31, 2016 Share Posted August 31, 2016 I'm sure you can do something with the ready() method to manually return a response. Perhaps you could even implement a router to handle this? I'm using nikic/FastRoute for the new iteration of Jumplinks. It can also be used for this kind of thing, I am sure. Or perhaps there's another way I don't know about - someone else will chime in if there is. Link to comment Share on other sites More sharing options...
blynx Posted August 31, 2016 Author Share Posted August 31, 2016 Hej Mike, thanks for your response! So, I'd use the ready-function-approach like echoing my data and then die() to prevent loading execute() and all the rest? Will have a look at the router and your implementation later - sounds interesting - Link to comment Share on other sites More sharing options...
horst Posted August 31, 2016 Share Posted August 31, 2016 I'm not very familiar with the process pages, but every time I used it, there was no Adminpage involved. ? If you have a look at the ProcessCropableImage3 module, it previous opened in a blank tab, and now in a modal window. But only contains it own content. There is made use of a HTML-template with PHP-vars, what gets populated when rendering. There is no need for templates or pages in the pagetree. 1 Link to comment Share on other sites More sharing options...
horst Posted August 31, 2016 Share Posted August 31, 2016 Here's another example: https://github.com/horst-n/LocalAudioFiles/blob/master/site-default/modules/LocalAudioFiles/LocalAudioFiles.module#L121 The view file: https://github.com/horst-n/LocalAudioFiles/blob/master/site-default/modules/LocalAudioFiles/view.php gets intantiated here: https://github.com/horst-n/LocalAudioFiles/blob/master/site-default/modules/LocalAudioFiles/LocalAudioFiles.module#L53 1 Link to comment Share on other sites More sharing options...
blynx Posted August 31, 2016 Author Share Posted August 31, 2016 Hi @horst! Hmmm - when I access an admin page with a process like "http://domain.de/processwire/customadmin" the output of execute() will be put into the admin interface - How are you accessing/displaying those pages? Where can I find the place where the modal windows gets created/called? Couldn't find it right now ... Link to comment Share on other sites More sharing options...
horst Posted September 1, 2016 Share Posted September 1, 2016 For a croppable image edit page (the old modul version) opening in a new window is used: <a href="http://localhost/processwire/page/croppable-image/?filename=scheuermann_aussen.jpg&suffix=cropname&width=780&height=190&pages_id=1&field=header_images" target="_blank">cropname</a> Opening in a modal I now use: <a href="http://localhost/processwire/page/croppable-image-3/?filename=scheuermann_aussen.jpg&suffix=cropname&width=780&height=190&pages_id=1&field=header_images&modal=1">cropname</a> The page / croppable-image is a Processpage that get created during module ___install() routine. 1 Link to comment Share on other sites More sharing options...
blynx Posted September 2, 2016 Author Share Posted September 2, 2016 Hej! Aha! Thanks @horst for the hints, I found out that simply providing the "modal=1" GET variable will render any process page without the processwire interface. Leaving it out you will see the process inside processwire. Clever thing ... Cheers, Steffen EDIT: ok ... the modal version still has processwire <head> and stuff - so that's not what I want. I found another solution for my problem (maybe even better), but if anyone has any idea how to completely replace the markup from the admin page, let me know! 1 Link to comment Share on other sites More sharing options...
apeisa Posted September 3, 2016 Share Posted September 3, 2016 Just make the page using another template than admin? Link to comment Share on other sites More sharing options...
apeisa Posted September 3, 2016 Share Posted September 3, 2016 Sorry, noticed that you don't want to go with this route. I think it is much cleaner than hooking into page render. Link to comment Share on other sites More sharing options...
blynx Posted September 3, 2016 Author Share Posted September 3, 2016 Hi apeisa, actually I am using a template file now - because I "found out" that the stuff I want to render gets the data from a page under that process and they exist anyway. ... Too obvious ... Still, I'd like a solution where I wouldn't have to move some template file from that module into the site/templates folder. Feels kinda like "pollution" for me. Wonder if it is possible to trick processwire into thinking a page without template file actually has one and tell it to take a file from the module folder? Link to comment Share on other sites More sharing options...
horst Posted September 3, 2016 Share Posted September 3, 2016 You don't have to move files into templates folder. I have linked to solutions with template files stored in the modules folder already above: https://github.com/horst-n/LocalAudioFiles/blob/master/site-default/modules/LocalAudioFiles/LocalAudioFiles.module#L53 https://github.com/horst-n/LocalAudioFiles/blob/master/site-default/modules/LocalAudioFiles/LocalAudioFiles.module#L121 https://github.com/horst-n/LocalAudioFiles/blob/master/site-default/modules/LocalAudioFiles/view.php 1 Link to comment Share on other sites More sharing options...
blynx Posted September 5, 2016 Author Share Posted September 5, 2016 Thanks horst for the list and for pointing things out! But I think this doesn't fit my needs? I want to display that template in an iframe which should not have any processwire markup added. The modal mode removes the processwire interface but still includes pw css, js, header, this and that… But I also found another reason for copying the template file into site/templates - it might be useful to edit that file and modify the rendering of those pages. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now