We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13736
    • 345 Posts
    When everyone was developing the SMF Bridge module, was it ever considered to try to build a snippet to allow the entire forum to be embeded into the content area of a page?

    I would idealy like to to have the same header on my forums section as the rest of the site. Is there some reason this embeding the forum wouldn’t work properly?

      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Probably because it’s not all that difficult to "skin" the forum to match your site, while "embedding" would be a nighmare.
        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
        • 13736
        • 345 Posts
        That’s what I was wondering. How much of a nightmare embedding would be. Otherwise, I’m wanting to create a top menu bar that pulls it’s menus from MODx. Maybe that’s not possible either.

          • 33337
          • 3,975 Posts
          Zaigham (aka zi) Reply #4, 20 years ago
          Search for "wrapper" snippet, it should do what you want.

          regards.

          zi

          [edit] This post should give you the wrapper snippet code: http://modxcms.com/forums/index.php/topic,7169.0.html and a solution to problem a user had with it.
            Zaigham R - MODX Professional | Skype | Email | Twitter

            Digging the interwebs for #MODX gems and bringing it to you. modx.link
            • 32963
            • 1,732 Posts
            Quote from: jbjones at Oct 12, 2006, 01:13 AM

            That’s what I was wondering. How much of a nightmare embedding would be. Otherwise, I’m wanting to create a top menu bar that pulls it’s menus from MODx. Maybe that’s not possible either.

            It’s posible to integrate MODx menus into SMF. I did something similar once for ZenCart.

            Here’s how it can be done:

            1) download MODxAPI and add it to the root of your site .Download here http://modxcms.com/MODxAPI-Library-865.html
            2) create a file call sitemenu.php (or use some other name)
            3) inside sitemenu.php add the following:

            <?php
            
            $path = '/path/to/site/root/';
            include_once($path.'modxapi.php');
            
            $modx = new MODxAPI();
            // connect to db and load settings
            $modx->connect();
            $modx->getSettings();
            
            $html = $modx->getChunk('Menu-StyleSheet');
            $html.= $modx->runSnippet(DropMenu,array('topnavClass'=>'nav', 'selfAsLink'=>'true'));
            echo $html;
            
            ?>


            4) You final step is to modify your SMF template to include the sitemenu.php file

            That’s it!
              xWisdom
              www.xwisdomhtml.com
              The fear of the Lord is the beginning of wisdom:
              MODx Co-Founder - Create and do more with less.
              • 13736
              • 345 Posts
              Cool. I’ll take a look at both of those and see what it looks like.
                • 13736
                • 345 Posts
                Quote from: xwisdom at Oct 12, 2006, 03:22 AM


                It’s posible to integrate MODx menus into SMF. I did something similar once for ZenCart.

                Here’s how it can be done: ....


                I’m not sure I completely understand how I’m getting the MODx menu to appear in the SMF template. You are saying getChunk... does that need to be a chunk with my CSS information pasted in? And then the Drop menu or Wayfinder call. Do I need to be inserting some of my main template code into this PHP file to get the full layout? Or does that goe in the SMF template with this PHP file called in the exact location where I want the active menu to appear?

                I guess I’m not sure how or when the PHP file should get inserted into the SMF template.


                  • 32963
                  • 1,732 Posts

                  IMO the first thing to do is to look for the index.template.php file inside your SMF themes/TemplateName/ folder where TemplateName is the name of your SMF template.

                  Inside the index.template.php file you will find three functions: template_init, template_main_above and template_main_below. The template_main_above function is used to render the top banners and menus of your smf page. This is the function you will need to modify to include your MODx menu file (e.g. include sitemenu.php).

                  You are saying getChunk... does that need to be a chunk with my CSS information pasted in? And then the Drop menu or Wayfinder call.


                  This is optional but yes, the css (if any) for the MODx menu can be added to a chunk. You can also choose to insert the css code directly inside your SMF template.

                  Do I need to be inserting some of my main template code into this PHP file to get the full layout? Or does that goes in the SMF template with this PHP file called in the exact location where I want the active menu to appear?


                  The modx menu php file is primarily used for getting the menu from modx. If you would like to add some additional HTML code to your SMF template then you can choose to either insert it inside the sitemenu.php file or inside your SMF template (index.template.php).

                  Hope this helps.


                    xWisdom
                    www.xwisdomhtml.com
                    The fear of the Lord is the beginning of wisdom:
                    MODx Co-Founder - Create and do more with less.