We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3749
    • 24,544 Posts
    You might be able to do that with Babel (I've never used it). You could definitely do it with Revolution Contexts, though they can be tricky to set up at first.
      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
      • 33238
      • 388 Posts
      Babel, this babel? http://rtfm.modx.com/extras/revo/babel

      it is not a multilingual extra, like Yams?
        --
        ysanmiguel.com
        • 3749
        • 24,544 Posts
        Yes, it's a multilingual extra, but you might be able to use it to simulate contexts in Evolution. I believe it makes modifications to the site based on the URL the user comes in on, which essentially what you want.
          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
          • 33238
          • 388 Posts
          Excellent, I can try it, but there is not any possibility to do that with Evo? impossible?
            --
            ysanmiguel.com
            • 3749
            • 24,544 Posts
            Sorry, I thought there was a version of Babel for Evolution. It look like there isn't, so I'd suggest that you just use Revolution Contexts and forget about Babel.
              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
              • 33238
              • 388 Posts
              Excellent, thank you, I will try!
              and lets see how it works.

              Anyway, any other idea night be welcome!
              Thank you!
                --
                ysanmiguel.com
                • 4041
                • 788 Posts
                Here is a simple proof of concept idea, master being the main site and slave being a seperate site:

                usage:
                create a chunk in your master installation named "global_elements_chunk1" ( no quotes )
                global_elements_chunk1 content:

                <p>this is global_elements_chunk1 content</p>


                create snippet(s) named global_elements with the following code in your master and slave sites,adjusting the path to the file accordingly:

                // master | slave
                $page_type ='slave';
                include 'C:/wamp/www/modx1012_xforum/assets/snippets/global_elements/global_elements.processor.php';
                


                add snippet call to the top of your templates
                [!global_elements!]

                add the placeholder call to your temlates
                [+global_elements.chunk1+]

                create a file named global_elements.processor.php with the code below, modifying the database details in the slave section of the switch.
                upload the file somewhere safe in your file system since there are database details shown.
                defined( 'IN_PARSER_MODE' ) or die( '<b>UNAUTHORIZED_ACCESS_ERROR</b>' );
                
                if( isset( $page_type ) ){
                
                    switch( $page_type ){
                    
                        case 'master':
                
                            $chunks_table = $modx->getFullTablename( 'site_htmlsnippets' );
                            
                        break;
                        
                        case 'slave':
                        
                            $master_db_server   = 'localhost';
                            $master_db_user     = 'root';
                            $master_db_password = '';
                            $master_db_name     = '`modx1012_xforum`';
                            $master_db_prefix   = 'modx1012_';
                
                            //connect to master db
                            $master_conn = $modx->db->connect( $master_db_server, $master_db_name, $master_db_user, $master_db_password, true );
                
                            $chunks_table = $master_db_prefix.'site_htmlsnippets';
                            
                        break;
                       
                        default: '';
                    }
                
                
                    $chunk1 = $modx->db->getValue( $modx->db->select( "snippet", $chunks_table, 'name="global_elements_chunk1"' ) );
                
                    $modx->setPlaceholder( 'global_elements.chunk1', $chunk1 );
                    
                    
                    if( $page_type =='slave' ){
                
                        //disconnect
                        $modx->db->disconnect();
                
                        //reconnect to modx db
                        $modx->db->connect();
                
                    }
                }
                


                  xforum
                  http://frsbuilders.net (under construction) forum for evolution