We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18397
    • 3,250 Posts
    Quote from: rthrash at Sep 12, 2005, 02:27 AM

    I thought there was a snippet floating around these forums that pulled the entire page from another doc, but I can’t seem to find it...
    Found it!
    ShowDoc (via Etomite)
    • Quote from: infoclipper at Sep 12, 2005, 12:22 PM

      Ryan, you know that request amuses me, given our dialogue over the past month.  ;-)
      Yes, I know... but it’s what I need for this particular job I’m working up a bid for!

      BTW, I keep getting an error when trying to post:
      "Your session timed out while posting. Please try to re-submit your message."

      Any idea what is causing that?

      I have to hit submit about 5 or 6 times before the message finally goes up...
      I have no clue, although I’m fairly certain switching to a shiny new Mac would fix it! LOL
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
      • Quote from: Mark at Sep 12, 2005, 02:15 PM

        Found it!
        ShowDoc (via Etomite)

        Here’s important bits of the code:
        $output = '';
        
        $tbl = $this->dbConfig['dbase'].".".$this->dbConfig['table_prefix']."site_content";
        $sql = "SELECT content FROM $tbl WHERE $tbl.id = $id";
        $rs = $modx->dbQuery($sql);  
        $resource = $modx->fetchRow($rs);
        
        $output = $resource['content']; 
        
        return $output;

        That still doesn’t address the usage of any TVs, or of the surrounding template for that matter. I could get around the template issue fairly easilty by putting a copy of the template in a blank-template page and using that (effectively putting the entire template inside the [*content*]. Any ideas on how to make this work with TVs?

          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 18397
          • 3,250 Posts
          Hmmmmmm. No idea as to how to make it work with TV’s (I don’t know the TV API well enough).

          Sorry.

          Raymond?
          • You can use the @DOCUMENT binding to include any document’s content via a TV. See http://modxcms.com/document.html for more information.
            • Does @DOCUMENT include everything on the page, including the TVs adn templates?
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • Nope, just the content, ready to include in your document...
                  • 18397
                  • 3,250 Posts
                  Quote from: rthrash at Sep 13, 2005, 02:13 AM

                  Does @DOCUMENT include everything on the page, including the TVs adn templates?

                  GrabPage does.

                  # Usage:
                  # [[GrabPage?url=full_URL_no_quotes]]
                  
                  return file_get_contents($url);
                  
                  


                  Simple fast and effective. It pulls EVERYTHING from the page as the browser sees it.

                  You can use my Etomite version (http://www.etomite.org/forums/index.php?showtopic=3067) if you want to use any replacements or strips. It uses functions and variables for this reason.