Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Bottom
Module Dev Q: Printable View
  • Posted: 14.04.2004, 01:57
     
    mhalbrook
    rank:
    Legend Legend
    registered:
     December 1969
    Status:
    online
    Posts:
    6533
    I'm developing a module for a client and I need to beable to present a printable view of one of the reports, with out the pnFrame, how do I do this?

    Do I just have to make the print function non API compliant?
  • Posted: 15.04.2004, 02:55
     
    franz.skaaning
    rank:
    Helper Helper
    registered:
     December 2002
    Status:
    offline
    last visit:
    24.11.08
    Posts:
    176
    Dont include the header then. Or use the AutoTheme function to call special layout page and CSS file for that particular pagetype.
  • Posted: 15.04.2004, 03:05
     
    rank:
    Moderator Moderator
    registered:
     March 2002
    Status:
    offline
    last visit:
    26.08.08
    Posts:
    7720
    For the moment if you don't return the output back to PN then you can output your own header and footer within a function. For PN .8x we'll have a printer theme that will allow a printable view from any page of a site by appending theme=Printer to the URL.

    -Mark
  • Posted: 15.04.2004, 03:08
     
    franz.skaaning
    rank:
    Helper Helper
    registered:
     December 2002
    Status:
    offline
    last visit:
    24.11.08
    Posts:
    176
    That could also very easily be made for 0.726 I guess.
  • Posted: 15.04.2004, 03:09
     
    mhalbrook
    rank:
    Legend Legend
    registered:
     December 1969
    Status:
    online
    Posts:
    6533
    So, what, just use standard echo/print statements rather than pnHTML for it then Mark?
  • Posted: 15.04.2004, 03:17
     
    rank:
    Moderator Moderator
    registered:
     March 2002
    Status:
    offline
    last visit:
    26.08.08
    Posts:
    7720
    It doesn't really matter if you use pnHTML or standard echo's.... Under pnHTML all you'd do is use

    Code

    // your pnhtml output creation snippped.....
    echo $output->GetOutput();
    exit;


    at the end of your function.

    -Mark
  • Posted: 15.04.2004, 03:43
     
    mhalbrook
    rank:
    Legend Legend
    registered:
     December 1969
    Status:
    online
    Posts:
    6533
    Ah got ya. Should make it easier to do also, I can use an if statement to see if it should print or not.
  • Posted: 15.04.2004, 03:55
     
    mhalbrook
    rank:
    Legend Legend
    registered:
     December 1969
    Status:
    online
    Posts:
    6533
    Thanks, now I just need to write the search function and make sure I didn't miss any security checks and I can get paid :)
  • Posted: 15.04.2004, 10:27
     
    ColdRolledSteel
    rank:
    Professional Professional
    registered:
     December 1969
    Status:
    offline
    last visit:
    30.12.05
    Posts:
    1310
    You could also use the PrintAnyPage hack from www.mtrad.com. It does what you want.

    (And I'm pretty sure that's where they got the idea for PN .8)
  • Posted: 15.04.2004, 10:48
     
    mhalbrook
    rank:
    Legend Legend
    registered:
     December 1969
    Status:
    online
    Posts:
    6533
    THe thing with the blockless theme method is that it still has the module's navigation in it, which I'd not want in the print view.

    Last question, I've got the printable view function written (pretty easy) but what I'd like is to make the view open in a second window, so I don't have to put any navigation stuff on there. Does taht mean I need to make the URL with out use of pnModURL? (Or whatever that function is) or is there some way to pass the open in new window to the function?
  • Posted: 15.04.2004, 13:42
     
    rank:
    Moderator Moderator
    registered:
     March 2002
    Status:
    offline
    last visit:
    26.08.08
    Posts:
    7720

    mhalbrook

    THe thing with the blockless theme method is that it still has the module's navigation in it, which I'd not want in the print view.

    Last question, I've got the printable view function written (pretty easy) but what I'd like is to make the view open in a second window, so I don't have to put any navigation stuff on there. Does taht mean I need to make the URL with out use of pnModURL? (Or whatever that function is) or is there some way to pass the open in new window to the function?


    I'd attach a little bit of javascript code to the link or button to open a new window of a fixed size if you really must have it in a new window. If using a link you could use target="_blank" but I wouldn't recommend this since it won't validate to strict HTML or XHTML doc types.

    Opening things in a new window without giving the user a choice is bad interface design hence the removal of the target attribute. This particular facet of design has really hit me since i've started using a browser with tabbed browing. It now annoys me when a site pops up a new window from a link. If i'd have wanted a new window i'd have right clicked and asked the link to be opened in one.

    -Mark
  • Posted: 15.04.2004, 13:45
     
    rank:
    Moderator Moderator
    registered:
     March 2002
    Status:
    offline
    last visit:
    26.08.08
    Posts:
    7720

    ColdRolledSteel

    You could also use the PrintAnyPage hack from www.mtrad.com. It does what you want.

    (And I'm pretty sure that's where they got the idea for PN .8)


    Craig,

    Your always an inpsiration..... ;) Seriously though, yes, it was in part your printanypage hack that brought the theme about. A print.php hack posted to noc.postnuke.com ended up as some xanthia plugins to deal with the links being turned into footnotes feature.

    -Mark
  • Posted: 15.04.2004, 23:24
     
    franz.skaaning
    rank:
    Helper Helper
    registered:
     December 2002
    Status:
    offline
    last visit:
    24.11.08
    Posts:
    176

    Quote

    A print.php hack posted to noc.postnuke.com ended up as some xanthia plugins to deal with the links being turned into footnotes feature.

    Where can I find this one? That would be nice for the PDF thing I did.
  • Posted: 15.04.2004, 23:29
     
    rank:
    Moderator Moderator
    registered:
     March 2002
    Status:
    offline
    last visit:
    26.08.08
    Posts:
    7720
    It's in the PostNuke project's patch section (under the closed patches). I don't have the exact reference to hand.

    -Mark
  • Posted: 16.04.2004, 00:01
     
    franz.skaaning
    rank:
    Helper Helper
    registered:
     December 2002
    Status:
    offline
    last visit:
    24.11.08
    Posts:
    176
    Found it right away, thanks Mark.

Extensions Moderation

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula