Page 1 of 1

Admin page without admin furniture [solved]

Posted: Tue May 03, 2011 4:19 pm
by cowtan
Hi - I'm starting development of my first module. It will have very simple functionality and doesn't have any front-end functionality.

Essentially, it will display a list of orders that have been made (via Foxycart), allowing an admin to view the orders and print out details to be included in a package slip.

I'm making slow but steady progress on how to do this but I'm not sure how to create the page which gets printed out. I can pull the information out of the database and display it on a page but I want to be able to display it in a pop-up window without any of the usual CMSMS furniture (ie menus, header, footer etc).

Usual apologies in advance if I've posted this in the wrong place, it doesn't make sense or the answer is blindingly obvious.

thanks,
Gordon

Re: Admin page without admin furniture

Posted: Thu May 05, 2011 6:17 am
by Duketown
cowtan,

I have found (FPDF) to be of great help in these situations. In your case it could be handy to later send invoice or something.
So the flow would be: request the package slip to be prepared and once prepared display it automatically (in new window/tab) and print is.

Using PDF is one solution, there are bound to be more alternatives.

Duketown

Re: Admin page without admin furniture

Posted: Thu May 05, 2011 9:43 am
by cowtan
Thanks Duketown. I'm actually happy creating the page in HTML (I have the layout from the previous site which I can use). But thanks for the suggestion anyway.

Gordon

Re: Admin page without admin furniture

Posted: Thu May 05, 2011 10:10 am
by Jos
I found a post from NaN on a completely different subject, but maybe it helps you:
NaN wrote:I would create a link using the CMSms module API passing urlonly=true that will link to a certain module action:

Code: Select all


$myActionUrl = $this->CreateLink($id, 'myAction', $returnid, 'click me', array('disable_theme'=>true','showtemplate'=>'false', ... ),'', true);

This will create a link that processes your module action. So you don't need to instanciate anything.
The params 'disable_theme'=>true' and 'showtemplate'=>'false' causes the CMS to not render anything else but just your module output. (no template in frontend, no backend theme)
So you could play around with params 'disable_theme'=>true' and 'showtemplate'=>'false'

I found another parameter for CreateLink $targetcontentonly in the module API
http://www.cmsmadesimple.org/apidoc/CMS ... CreateLink
I don't know what that does, but you might want to try that one too.

Re: Admin page without admin furniture [solved]

Posted: Thu May 05, 2011 2:58 pm
by cowtan
Thanks Jos, that looks like exactly what I was after. Much appreciated.

cheers,
Gordon