Fork me on GitHub

"Print" view?  Bottom

  • In the current module I'm working on, I want to have an option for the user to click on a link and have a pop-up window appear, showing the same information the previous page did, but in a clean format, minus the Postnuke stuff, so that they can print just that information. Is there a way to do this and still have it all compliant and stuff? My brain is not coming up with anything, but I had a root canal yesterday, so I am likely missing something that's blindingly obvious. :?
  • I've been playing around with the "popup" code, but it doesn't seem to do quite what I want it to do. I get a little pop-up window, but it looks more like the onMouseOver stuff you can do with Javascript than what I really want.
  • Okay, now I feel like an idiot.

    My plan: Make a link on the Postnuke page with a target to go to a new window. Send it the information I need, or at least the id of the information I need. Use that form to print out the "print view." I think I'm going to get lunch before I try that.

    Any other ideas would be greatly appreciated.
  • I take it all back. I have no idea how to do this. I've been trying all afternoon. *beats head on desk*

    It would all be pretty simple if I could send an array through a form. Otherwise, I'm going to have to include database calls and stuff, and I KNOW there's gotta be an easier way.

    Pop-ups, anyone?
  • I would design a no frills theme and then call a second window with the URL and ?theme=blandtheme on the end.

    --
    Zikula Themes
  • *falls down and worships at your feet*

    That was brilliant. *kowtows* THANK YOU!!!!
  • PN .760 comes with a printer theme for this exact purpose.

    -Mark

    --
    Visit My homepage and Zikula themes.
  • Ooo, that's totally awesome! I haven't upgraded to .760 yet. Not sure that I will just yet, but it's good to know. :)
  • 760 is still in RC stages at the moment, CRS has a printer type theme at MTRad.com I think.

    --
    Home Page | Find on Facebook | Follow on Twitter
  • It's called PrintAnyPage from http://www.mtrad.com.
  • To display content without the postnuke stuff
    you can just do the following ( note that display()
    is used instead of fetch() ):

    Code

    $pnRender =& new pnRender('MODULE');
       
        $pnRender->assign('whatever', $whatever);

        // output html
        $pnRender->display('MODULE_print_something.tpl');

        // tell postnuke not to output anything else
        return true;



    Alexan
  • alexan

    To display content without the postnuke stuff
    you can just do the following ( note that display()
    is used instead of fetch() ):


    Yes.... but the advantage of the theme approach is that it's a one off solution that then doesn't require any coding within the module - Every single 'page' within the site has an instant printable view. In .760 we've dropped the printable page code from the sections module and used the printer theme instead.

    You could incorporate into your theme templates a link that views the current page with &theme=Printer appended.

    At the end of the day why write code you don't have too...

    -Mark

    --
    Visit My homepage and Zikula themes.
  • yes Mark you right theme is the quickest/easiest way.

    I was just giving more options ...
    the display() approach could be used
    if you want to reformat the display
    of your data for better printing
    (rather than browser viewing)

    or

    maybe have a lot of different printing
    frames for different data ... I'd
    rather have 5 templates than 5 different
    themes for this

    I know theme could do both …
    alternatives do no harm though icon_wink

    nice "footnotes" plugin in the Printer theme by the way...

    Alexan

    --
    Cytopia - Download Psytrance




    Athens Pub Crawl
  • I did a combination of both. There were certain things I didn't need displayed in the print view (Edit and Delete links, frex, and colors, too) that I needed in the regular view, so I made print view functions to not display those, and then I made the bland theme to display without the postnuke bars and block. Quite easy, once I figured out how to make the theme. :)
  • 0 users

This list is based on users active over the last 60 minutes.