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 11, 2005, 09:27 PM

    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)
      • 25663 MODX Staff
      • 12,272 Posts
      Quote from: infoclipper at Sep 12, 2005, 07:22 AM

      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
        • 25663 MODX Staff
        • 12,272 Posts
        Quote from: Mark at Sep 12, 2005, 09:15 AM

        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?
            • 22303 MODX Staff
            • 10,725 Posts
            You can use the @DOCUMENT binding to include any document’s content via a TV. See http://modxcms.com/document.html for more information.
              • 25663 MODX Staff
              • 12,272 Posts
              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
                • 22303 MODX Staff
                • 10,725 Posts
                Nope, just the content, ready to include in your document...
                  • 18397
                  • 3,250 Posts
                  Quote from: rthrash at Sep 12, 2005, 09:13 PM

                  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.