We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36526
    • 46 Posts
    Hi, starting from a working template, can I use #include PHP command for include another site (with own layout) in a content Revo page?? Means that keeping current Revo layout, I want to include PHP script (that have own include files, layout etc...)in existing Revo site.

    Thanks
      • 3749
      • 24,544 Posts
      No, all PHP code has to be in snippets or plugins.

      #include, BTW, is not PHP code. AFAIK, it's a custom directive put in HTML comments in asp. You could put it in the resource content field, but you'd just see it on the page unless asp is rendering the page.

      You might be able to render the remote page in an iframe with href. Another method would be a snippet that uses cURL to get and return the remote page.
        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
        • 36526
        • 46 Posts
        Can you detail me what I've to exactly??

        Include is a PHP command:
        http://php.net/manual/en/function.include.php

        Isn't there an easy way for include existing PHP page in layout?
        Creating a Snippets that includes external PHP scripts for example

        Thanks
          • 3749
          • 24,544 Posts
          'include' is a php statement, '#include' is a comment as far as PHP is concerned. I just wanted to make sure you didn't think that #include was going to do anything.

          I'm not sure what you mean by a 'PHP page', but try this (using the real URL of the page as the src):

          <iframe src="http://somewhere.com/page.html" width="300" height="300">
              <p>iframes disabled</p>
          </iframe> 


          or this:

          <iframe src="http://somewhere.com/page.php" width="300" height="300">
             <p>iframes disabled</p>
          </iframe> 


            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
            • 40045
            • 534 Posts
            If the files are on the same server you could also try http://modx.com/extras/package/includesnippet
              • 36526
              • 46 Posts
              Quote from: BobRay at Feb 16, 2013, 08:21 PM
              'include' is a php statement, '#include' is a comment as far as PHP is concerned. I just wanted to make sure you didn't think that #include was going to do anything.

              I'm not sure what you mean by a 'PHP page', but try this (using the real URL of the page as the src):

              <iframe src="http://somewhere.com/page.html" width="300" height="300">
                  <p>iframes disabled</p>
              </iframe> 


              or this:

              <iframe src="http://somewhere.com/page.php" width="300" height="300">
                 <p>iframes disabled</p>
              </iframe> 




              Thanks for your reply!! I'll try to apply your solutions!!
                • 36526
                • 46 Posts
                Quote from: exside at Feb 17, 2013, 08:06 AM
                If the files are on the same server you could also try http://modx.com/extras/package/includesnippet


                Reading....

                All you need is folder core/snippets/

                means that I could have my entire app in this main folder (my app with all subfolders and images) and simply include main page of this app (index home page)?? all pages linked and called from php script index page will be opened in my main Modx layout??


                Thanks
                  • 36526
                  • 46 Posts
                  When I try to include iframes tag in HTML mode, when I return in HTML mode after saving page I show
                  <p>iframes disabled</p>

                  why other tags are still in HTML and this is changed?

                  Thanks
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    If you are putting the iframe in the Rich Text editor, it will remove them. Put the iframe code in a chunk, then put the chunk tags in the resource's content. Or, disable the Rich Text editor for that resource.
                      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