We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22897 ☆ A M B ☆
    • 209 Posts
    Hi,

    Using 1.0.1 and the bundled ManagerManager, the rules to give IDs to the section of the form no longer appear to work, breaking renameSection and other MM commands:
    	  // Change section index depending on Content History running or not                  
          var sidx = ($j("div.sectionBody:eq(1)").attr("id") == "ch-body")?1:0;  //ch-body is the CH id name (currently at least)
          
          // Give IDs to the sections of the form
          // This assumes they appear in a certain order
          $j("div.sectionHeader:eq(sidx)").attr("id", "sectionContentHeader");
          $j("div.sectionHeader:eq(sidx+1)").attr("id", "sectionTVsHeader");
       
          $j("div.sectionBody:eq(sidx+1)").attr("id", "sectionContentBody");
          $j("div.sectionBody:eq(sidx+2)").attr("id", "sectionTVsBody");


    Anyone got a fix already?
      MAPLEDESIGN MODX development and MODX web design and custom development. Proud to serve UK and International clients!
      • 5904
      • 58 Posts
      Hi,

      I’m using rules in a chunk called mm_rules. Rules work when applied to Fields but do not work when applied to Sections. For example:

      mm_renameField(’introtext’,’Summary’); //Works

      mm_hideFields(’pagetitle,menutitle,link_attributes,template,menuindex,description,show_in_menu,which_editor,is_folder,is_richtext,log,searchable,cacheable,clear_cache’, $news_role); //Works

      but,

      mm_renameSection(’content’,’Full story’); // Doesn’t work

      mm_hideSections(’tvs’); // Doesn’t work

      Any solutions gratefully received smiley


      [Using Evo 1.0.1 and MM 0.3.5]
        • 28788
        • 79 Posts
        I’m having the same issue in 1.0.2. Should this be in the ManagerManager section?
          • 5904
          • 58 Posts
          Check this out:

          http://modxcms.com/forums/index.php/topic,41241.0.html

          Ryan’s fix works for hiding content section [ use mm_hideField(’content’) ]

          Best wishes smiley
            • 21257 MODX Staff
            • 730 Posts
            I’m also run into this problem with Sections.

            This code that runs on documentReady:
            $j(document).ready(function() {
            	
            	// Lets handle errors nicely...
            	try {
            						   					
            	  // Change section index depending on Content History running or not                  
                  var sidx = ($j("div.sectionBody:eq(1)").attr("id") == "ch-body")?1:0;  //ch-body is the CH id name (currently at least)
                  
                  // Give IDs to the sections of the form
                  // This assumes they appear in a certain order
                  $j("div.sectionHeader:eq(sidx)").attr("id", "sectionContentHeader");
                  $j("div.sectionHeader:eq(sidx+1)").attr("id", "sectionTVsHeader");
            


            .. is running behind the page loading mask, and doesn’t appear to work. It doesn’t assign the ’sectionContentHeader’ and ’sectionTVsHeader’ to the divs as it is trying to do.

            If I run the same code in a javascript console after the loading mask disappears, then it works.

            I suspect a small tweak is needed to make sure this code runs at the right time.
              Mike Schell
              Lead Developer, MODX Cloud
              Email: [email protected]
              GitHub: https://github.com/netProphET/
              Twitter: @mkschell
              • 21257 MODX Staff
              • 730 Posts
              Above confirmed in recent 0.3.7 release.
                Mike Schell
                Lead Developer, MODX Cloud
                Email: [email protected]
                GitHub: https://github.com/netProphET/
                Twitter: @mkschell
                • 21671
                • 244 Posts
                HI All,

                My solution at http://modxcms.com/forums/index.php/topic,43390.0.html will maybe help your section problems.

                Best regards,

                Noah
                  • 21257 MODX Staff
                  • 730 Posts
                  Thanks noahlearner smiley
                    Mike Schell
                    Lead Developer, MODX Cloud
                    Email: [email protected]
                    GitHub: https://github.com/netProphET/
                    Twitter: @mkschell
                    • 21671
                    • 244 Posts
                    did it work for you?