We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31074
    • 14 Posts
    I have a client who wants to print certain pages of his website as a pricetag. The layout of the prints should be completely different from the original webpage (no images, bigger font-size,etc.), so I’ve created another template & css for print.
    the question is:
    Is it possible to create some sort of button on a page wich is only visible to editors/admins that shows the same page in a new window with a different template?
    Plz let me know, or point me to another topic in wich this (or a similar problem) is covered... (couldn’t find it myself, but perhaps i’ve overlooked it)
    Thnx!!!
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Just an appropriate css file for print is sufficient. http://www.alistapart.com/articles/goingtoprint/

      However, if you want a "print preview" type page, then this will work: http://www.alistapart.com/articles/printtopreview/
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 31074
        • 14 Posts
        Thank you Susan for your reaction; unfortunately this is not what I was looking for.
        The information on the webpage has to fit on one A4 print page, so it needs a completely different layout from the original one.
        The easiest way I could think of is to change the page-template script-wise. But I don’t know if that’s possible, hence my question....
        Anyone??
        --------------

        Nevermind, solved this one with the ’changing-css’ solution, however not with the suggested script, but with a snippet. Your suggestion put me in the right direction though, so thank you!!

        Still, I’ve got one problem left:
        On the page is a ’print’-button which should only be visible to admins & editors and not to visitors. Can this be done easily?
          • 4971
          • 964 Posts
          Susan has a snippet called "ManagerCheck" that would do what you want...
          it is a clone of "MemberCheck", I have not used it, but she is the expert...
            Website: www.mercologia.com
            MODX Revo Tutorials:  www.modxperience.com

            MODX Professional Partner
            • 31074
            • 14 Posts
            Thanx, that is exactly what I was looking for!
            Except for.... I can’t get it to work properly....

            I have copied the ManagerCheck code and called it in a template like this:

            [!ManagerCheck? &groups=`belangrijk` &chunk=`printKnop` &default=`geenKnop` &debug=`true`!]


            But then I get the following error:
            « MODx Parse Error »
            MODx encountered the following error while attempting to parse the requested resource:
            « PHP Parse Error »
             
            PHP error debug
              Error: 	Invalid argument supplied for foreach()	 
              Error type/ Nr.: 	Warning - 2	 
              File: 	/home/sitename/domains/sitename.net/public_html/manager/includes/document.parser.class.inc.php(770) : eval()'d code	 
              Line: 	115	 
             
            Parser timing
              MySQL: 	0.0000 s	(5 Requests)
              PHP: 	0.0240 s	 
              Total: 	0.0240 s

              • 4971
              • 964 Posts
              I think that the snippet is called ManagerCheck and thus is assumed to be
              called like you do, but inside it says MemberCheck al over the place...
              that could be the problem...
                Website: www.mercologia.com
                MODX Revo Tutorials:  www.modxperience.com

                MODX Professional Partner
                • 31074
                • 14 Posts
                Nope... unfortunately, that doesn’t solve a thing.... sad