On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Is there is a way to link to templates from outside of the modx admin panel. Maybe linking with something like an includes statement. The inability to use tabs in the modx admin interface really slows down my productivity as far as developing inside modx. Copying and pasting from an editor every time I make a change is tedious also.
    • This Firefox plug in is great if you use Firefox

      http://modxcms.com/forums/index.php/topic,39090.msg235824.html#msg235824
      • If you want to use an external html file as a template you can create a snippet with the necessary include statement, and then put the snippet call in a MODX template.

        I haven’t been using MODx for too long, so there may another way.
        • My templates look like

          [[includeTemplate? &tpl=`business/awards-list.html`]]


          Because I could not find the original post I will post the snippet code here
          <?php
          # Snippet to include template files from file system
          # USAGE: [[includeTemplate? &tpl=`mytemplate/template.html`]]
          
          if ( !isset($tpl) || $tpl== "" ) return "Missing Template file!";
          
          $tpl = $base_path .'assets/templates/'.$tpl;
          ob_start();
          include($tpl);
          return ob_get_clean();
          ?>
          

          • Quote from: cipa at Sep 18, 2009, 04:39 PM

            My templates look like

            [[includeTemplate? &tpl=`business/awards-list.html`]]


            Because I could not find the original post I will post the snippet code here
            <?php
            # Snippet to include template files from file system
            # USAGE: [[includeTemplate? &tpl=`mytemplate/template.html`]]
            
            if ( !isset($tpl) || $tpl== "" ) return "Missing Template file!";
            
            $tpl = $base_path .'assets/templates/'.$tpl;
            ob_start();
            include($tpl);
            return ob_get_clean();
            ?>
            



            What does this mean for using tv’s or chunks in your template?
            • Here is a an example of a template.html file
              [[includeTemplate? &tpl=`site/head.html`]]
              
              <body class="home">
              
              
              <div id="homeW">
              <div id="homeLeft">
              
              	<div class="featured separator"><span>Featured Project:</span> [[GetField? &docid=`36` &field=`pagetitle`]]</div>
              	<div class="featuredDesc separator">[[GetField? &docid=`36` &field=`content`]]</div>
                  
                  <div id="homeFpNav">
                      <div id="extCtrlCarousel">
                          [[Wayfinder? &startId=`36` &outerTpl=`fpExtCtrlOuterTpl` &rowTpl=`fpExtNavRowTpl` &level=`1`]]
                      </div>
                      <div class="linkTo"><a href="[~[[GetField? &docid=`36` &field=`linkTo`]]~]">View Project »</a></div>
                  </div>
                  
                  
                  <div id="fpContentProjects">
              		<div class="fpPreviousPiece"></div>
              		<div id="homeCarousel">
              			<ul>
              				[[Ditto? &tpl=`fpItems` &parents=`36`]]
              			</ul>
              		</div>
              		<div class="fpNextPiece"></div>
              	</div>	
              	
              </div>
              <div id="homeRightW">
              	<div id="homeRight">
              		[*content*]
              	</div>
              </div>
              </div>
              
              <div id="menuWrapper">
              	<div id="menu">
              		[[Wayfinder? &startId=`0` &level=`1` &rowTpl=`mainMenuRowTpl` &titleOfLinks=`alias`]]
              	</div>
              </div>
              
              </body>
              </html>
              

              • MODxFS lets Unix users with FUSE mount MODx databases as filesystems. This means you can directly edit Chunks, Pages, Snippets, and Templates with your preferred HTML/PHP editor.

                http://modxcms.com/extras/package/?package=292

                Unfortunately the link is dead and I don’t think I could install on my shared hosting server.
                  DropboxUploader -- Upload files to a Dropbox account.
                  DIG -- Dynamic Image Generator
                  gus -- Google URL Shortener
                  makeQR -- Uses google chart api to make QR codes.
                  MODxTweeter -- Update your twitter status on publish.
                • Thnx for that snippet. It’s really useful.

                  WARNING FOR USERS:
                  To avoid surprises remember to clean your site cache after modifying your template smiley
                  • There is this hack --> http://modxcms.com/extras/package/73

                    Haven’t had the need for it yet... smiley
                      @hawproductions | http://mrhaw.com/

                      Infograph: MODX Advanced Install in 7 steps:
                      http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                      Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                      http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
                    • This works. However, I wasn’t naming my snippet correctly (discovered that while pouring over this post: http://modxcms.com/forums/index.php?topic=42928.0).

                      One of my MAJOR complaints about Modx so far is that this functionality isn’t a part of the default system. I just don’t understand why you would have to go through all this just to be able to edit a file in your editor of choice. However, that said, every time I start to consider the other options (EE being the only one I’ve found that seems to compare), I think about the modx team and community. The modx team (especially rthrash) are super professional and nice (even when speaking of other CMS systems) in every post I’ve read. Modx has, in my opinion, a lot of shortcomings, but it’s a lot easier to stick with it when you genuinely like and trust the people developing it.