We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28042 ☆ A M B ☆
    • 24,524 Posts
    This is an auto-generated support/comment thread for HelpManager.

    Use this forum to post any comments about this addition or any questions you have regarding its use.

    Brief Description:
    Creates a tabbed help panel in the Manager
      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
      • 23491 ☆ A M B ☆
      • 1,056 Posts
      Really cool resource! I am excited to try this one out.
        Mike Reid - www.pixelchutes.com
        MODx Ambassador / Contributor
        [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
        ________________________________
        Where every pixel matters.
        • 6726
        • 7,075 Posts
        Great addon indeed smiley

        I have started toying with it and it works fine !
        It would seem tabs are sorted alphabetically, am I wrong ?

        I am trying to sort them using 1-Name_of_page1, 2-Name_of_page2, 3-Name_of_page3 and tried A-Name_of_page1, B-Name_of_page2, C-Name_of_page3 but I got inconsistent results (i.e I get this order : 3 - 1 -2 or C - A - B). Any idea why ?

        Name of pages are : 1-Presentation, 2-Editer un Document, 3-Redimensionner une image
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l'outil id
          • 20289
          • 958 Posts
          Wow, thats great but is it possible to make it a little bit more global?
          Below line definition is preventing its globalization wink
          The filenames are important. The first part of the name will be used as the tab title, underlines will be replaced with spaces.
            [img]http://i10.tinypic.com/52c4eir.gif[/img][/td]
            [td][Wiki] [Persian support forum]
            [SVN] [RTL SVN Branch] [bugs] [FishEye+Crucible] [Learn MODx!] | [My Google Code]
            [font=tahoma][برای دسترسی به راهنمای فارسی به [url=http://www.modxcms.ir]
            • 6726
            • 7,075 Posts
            Back on the issue : did not find a fix yet to sort tabs... but I have another question : can I link from a tab to another ?
              .: COO - Commerce Guys - Community Driven Innovation :.


              MODx est l'outil id
              • 25663 MODX Staff
              • 12,272 Posts
              Here’s a quick question for you ... since the help content may be (and probably should be) site-specific, would it make more sense to locate the help files in the assets directory to make for easier upgrades? This would also be more in line with future releases for content structuring with 097 and beyond. I’m getting ready to commit this for 0962 and just thought about this... smiley
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 10449
                • 956 Posts
                @davidm: To sort the help items alphabetically, you could try this:

                if ($handle = opendir('help')) {
                    while (false !== ($file = readdir($handle))) {
                        if ($file != "." && $file != "..") {
                			$help[] = $file;
                        }
                    }
                    closedir($handle);
                }
                
                natcasesort($help);
                
                
                foreach($help as $k=>$v) {
                
                	$helpname =  substr($v, 0, strrpos($v, '.'));
                	$helpname = str_replace('_', ' ', $helpname);
                
                	echo '<div class="tab-page" id="tab'.$v.'Help">';
                	echo '<h2 class="tab">'.$helpname.'</h2>';
                	echo '<script type="text/javascript">tpResources.addTabPage( document.getElementById( "tab'.$v.'Help" ) );</script>';
                	include "./help/$v";
                	echo '</div>';
                }
                


                Basically just build an array while looping through the directory, and sort it later.

                If you wanted a custom tab-order, you could name your files with a two-digits prefix: 01Documents.php, 02FileUploads.php, 03Blog.php etc.
                Then just sort by filenames, but strip out the first two characters for the tab-display.
                i.e.
                foreach($help as $k=>$v) {
                	$helpname =  substr($v, 0, strrpos($v, '.'));
                	$helpname =  substr($helpname, 2, strlen($helpname)-1 ); // strip out first two chars
                	$helpname = str_replace('_', ' ', $helpname);
                
                  • 25663 MODX Staff
                  • 12,272 Posts
                  I like the leading two digits sort/strip thing ganeshXL... cool approach. I’m voting that this should be a part of it with 0962
                    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
                    Another request for error checking on prefixing with integers... could we check to see if the first two digits are in fact integers before stripping them from the name? That way it could work with or without prefixed filenames.
                      Ryan Thrash, MODX Co-Founder
                      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                      • 10449
                      • 956 Posts
                      Sure:

                      	$helpname =  substr($v, 0, strrpos($v, '.'));
                      
                      	$prefix = substr($helpname, 0, 2);
                      	if(is_numeric($prefix)) {
                      		$helpname =  substr($helpname, 2, strlen($helpname)-1 );
                      	}
                      
                      	$helpname = str_replace('_', ' ', $helpname);