We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3689
    • 264 Posts
    I’m creating a website and theres 2 simple features I’m interested in.. if you look here you can see the 2 features.

    1. On the Right where it says "Request an Appt." it sends you to another page with the name of the home already populating the "Subject" field of the form.

    2. When you click "Printable Flyer" it goes to a page which I guess would be a printable format but I would like to be able to format the page so I can have it the way I want

    I’ve been tryin to figure this out for a couple days now with no luck.. can any1 help?
      • 2206
      • 22 Posts
      1) you should use some php code for this. You can retrieve a value from the url, or use more sophisticated methods

      2) you can set a css file for print:

      <link rel="stylesheet" type="text/css" media="print" href="print.css" />

      When you print the page, you can design a totally different layout with css
        • 3689
        • 264 Posts
        Quote from: arx707 at Jan 14, 2010, 06:42 PM

        1) you should use some php code for this. You can retrieve a value from the url, or use more sophisticated methods

        2) you can set a css file for print:

        <link rel="stylesheet" type="text/css" media="print" href="print.css" />

        When you print the page, you can design a totally different layout with css

        ill have to figure out what to do for number 1.. as for number 2 can i change the template or show exactly how its going to be printed like it is on that website?
          • 11055 ☆ A M B ☆
          • 3,112 Posts
            Rico
            Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
            MODx is great, but knowing how to use it well makes it perfect!

            www.virtudraft.com

            Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

            Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

            Maintainter/contributor of Babel

            Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
            • 3689
            • 264 Posts
            Quote from: goldsky at Jan 14, 2010, 07:48 PM

            http://modxcms.com/forums/index.php/topic,19849.0.html

            could i use this for an alternative template for printing? seems it would generate a pdf and thats not what i would be lookin to do
              • 3749
              • 24,544 Posts
              I don’t think you want a .PDF file. Rather than a separate template, it’s usually better to just use a print CSS file: http://www.alistapart.com/articles/goingtoprint/
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 11055 ☆ A M B ☆
                • 3,112 Posts
                i’ve never used this,
                but i believe that’s what you’re looking for.
                just try to play with it for a while.
                it has &parent variable that suppose to referring to your Flyer page, which is using your custom template.
                  Rico
                  Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
                  MODx is great, but knowing how to use it well makes it perfect!

                  www.virtudraft.com

                  Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

                  Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

                  Maintainter/contributor of Babel

                  Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
                  • 3707
                  • 241 Posts
                  as for number 2 can i change the template or show exactly how its going to be printed like it is on that website?
                  If you just include a print stylesheet, you won’t see a screen preview of how the printed page will look. This is the method I use to get a preview.

                  The link to the printable version links to itself but adds the parameter ?pf=print to the URL.
                  <a href="[~[*id*]~]?pf=print" title="Printable Flyer">Printable Flyer</a>

                  Then in the head section of my template, I place this snippet call where the stylesheet links will appear:
                  [!printStyle!]

                  The contents of the snippet are:
                  <?php
                  $output = "";
                  if ($_GET['pf'] == "print") {
                  $output .= '<link rel="stylesheet" type="text/css" href="/path-to-css/print.css" media="all" />';
                  } else {
                  $output .= '<link rel="stylesheet" type="text/css" href="/path-to-css/default.css" media="screen" />
                  <link rel="stylesheet" type="text/css" href="/path-to-css/print.css" media="print" />';
                  }
                  return $output;
                  ?>

                  So, if ?pf=print has been appended to the URL, then print.css is included using media="all" so that both the screen and print views use the print stylesheet. Otherwise, the default stylesheet is used for screen display and the print version for printing. This way the page will always print with the correct stylesheet but you get a screen preview of the printed page.
                    • 3689
                    • 264 Posts
                    I would need to see a preview of the page like on the site i linked so I can change the template around and put the Agent’s name and contact information into the page b4 its printed.. i wouldnt want that on the main page.. is there a way to use an alternative template for a page? Like link to the same page with a command to change the template?
                      • 3707
                      • 241 Posts
                      That’s what you use the print stylesheet for. Instead of having a completely different html template, you have two CSS files.

                      So for the agent info, you include the data in the template but hide it in your main stylesheet, e.g. using display: none, then in the print stylesheet, just change the display value. Then in the print stylesheet, you can hide any of the other sections you don’t want to display and even change the layout.