We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5532
    • 251 Posts
    Hi There,

    Just wondering if it’s possible to set some Manager defaults like:
    - The default tab that is selected in Modx
    - And have a different default tab selected you’re creating a new page
    - Make "Continue Editing" the default behavior
    - Redirect the Manager page to edit the home page when you first login based on user ID

    Any help would be appreciated.

    Cheers

    Ben
      • 7455
      • 2,204 Posts
      you could create plugins for that I think.
        follow me on twitter: @dimmy01
        • 5532
        • 251 Posts
        Thanks for the reply, unfortunately I have zero PHP experience so creating a plugin is way out of my league.

        In the end I used ManagerManager http://evolution.webprogramming.ca/assets/plugins/managermanager/docs/: to hide all the standard tabs except the first one, create new tabs and move all the fields to the various tabs I wanted. That way I could control the order of the tabs as well.

        Still can’t find info on setting the default editing behavior to "Continue Editing" though...

        For my future reference - ManagerManager settings used:
        // RENAME AND CREATE TABS
        mm_renameTab('general', 'Edit Content');
        mm_createTab('Edit Sidebar', '4', '', '!3,7,8,9,10'); // Creates the Edit Sidebar tab with an ID of 4 on all templates except the home, minimal, sidebar, footer and header templates
        mm_createTab('Image Slider', '5', '', '6'); // Creates the Image Slider tab with an ID of 5 on the image gallery template only
        mm_createTab('Publish Settings', '6'); // Creates the Image Slider tab with an ID of 6
        mm_createTab('Advanced Settings', '7'); // Creates the Advanced Settings tab with an ID of 7
        
        // HIDE TABS
        mm_hideTabs('settings');
        
        // MOVE FIELDS TO TABS
        mm_moveFieldsToTab('is_folder', 'general');
        mm_moveFieldsToTab('searchable,longtitle,introtext,introImage,heroImage,tags,textBlock1,textBlock2,textBlock3,textBlock4,codeInjectionSummary,footerCopyright', 'general'); // Move fields to Edit Content tab
        mm_moveFieldsToTab('sidebarBlock1,sidebarBlock2,sidebarBlock3,sidebarBlock4,sidebarBlock5,sidebarPageSpecific1,sidebarPageSpecific2', '4'); // Move fields to Edit Sidebar tab
        mm_moveFieldsToTab('codeInjectionSlider,codeInjectionSliderNav,imageNumber', '5'); // Move to Image Slider tab
        mm_moveFieldsToTab('published,pub_date,unpub_date', '6'); // Move to Publish Settings tab
        mm_moveFieldsToTab('resource_type,content_type,content_dispo,is_richtext,log,cacheable,clear_cache', '7'); // Move fields to Advanced Settings tab
        
        // SYCRONISE FIELDS
        mm_synch_fields('pagetitle,longtitle');
        
        // HIDE FIELDS
        mm_hideFields('link_attributes');
        mm_hideFields('description');
        mm_hideFields('introtext', '', '8,5,9,10'); // Hides the Page Introduction field on non-rendering templates
        mm_hideFields('longtitle', '', '8,5,9,10'); // Hides the Page Headline field on non-rendering templates
        
        mm_widget_tags('tags');
        
        // RENAME FIELDS
        mm_renameField('pagetitle','Page Title');
        mm_renameField('longtitle','Page Headline');
        mm_renameField('alias','Page URL');
        mm_renameField('introtext','Page Introduction');
        mm_renameField('template','Page Template');
        
        // RECOMMENDED CHANGE TO AVOID A CONFLICT WITH AN EXISTING PLUGIN
        mm_widget_showimagetvs();



        Cheers
          • 27330
          • 884 Posts
            • 5532
            • 251 Posts
            Thanks! Will try that shortly...
              • 5532
              • 251 Posts
              I wasn’t sure from the thread if I was to duplicate the "Inherit Parent Template" plugin and alter it or make a new one and just paste in:
              $_GET['stay'] = "2"; 
              $_REQUEST['stay'] = "2";
              


              In the end, I duplicated the "Inherit Parent Template" plugin and pasted in the following code which worked:
              /*
              * Edited to make "Continue Editing" the default, more info at:
              * http://modxcms.com/forums/index.php/topic,44548.0.html
              *
               * Written By Raymond Irving - 12 Oct 2006
               *
               * Simply results in new documents inherriting the template 
               * of their parent folder upon creating a new document
               *
               * Configuration:
               * check the OnDocFormPrerender event
               *
               * Version 1.0
               *
               */
              
              global $content;
              $e = &$modx->Event;
              
              switch($e->name) {
                case 'OnDocFormPrerender':
                  if(($_REQUEST['pid'] > 0) && ($id == 0)) {
                    if($parent = $modx->getPageInfo($_REQUEST['pid'],0,'template')) {
                      $content['template'] = $parent['template'];
                    }
                  }
                  // set continue editing as default
              $_GET['stay'] = "2"; 
              $_REQUEST['stay'] = "2";
                  break;
              
                default:
                  return;
                  break;
              }


              Thanks for the info...

              Cheers
                • 27330
                • 884 Posts
                i think it should work with these 2 lines only.

                /*
                *  keep the "Continue editing" checked by default, can be useful with new 
                *  site where lots of 'save' clicks happens
                *  Check all the events you wish  to apply it for.
                *  clean code :) by dev_cw  
                *  http://modxcms.com/forums/index.php?topic=23532.msg146622#msg146622
                *
                */
                $_GET['stay'] = "2"; 
                $_REQUEST['stay'] = "2";