We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • When I know I have a number of rules to implement, I’ve found it helpful to organize them in a spreadsheet before I go coding.
    It’s also handy to have a reference afterwards for managing change, because staring a couple of dozen lines of MM function calls can be daunting if you’re in a hurry.

    Here’s an example of my blank template:
    http://sheet.zoho.com/templates/netprophet/mm-settings

    Here’s an example of one filled in (plus some notes and tips on usage):
    http://sheet.zoho.com/public/netprophet/managermanager-settings-example

    I’d love to know if anyone finds this useful, or if there are other techniques floating around out there.
      Mike Schell
      Lead Developer, MODX Cloud
      Email: [email protected]
      GitHub: https://github.com/netProphET/
      Twitter: @mkschell
      • 4310
      • 2,310 Posts
      Hey Mike,
      Nice idea.
      As you’ve seen before, I tend to use the mm_rules.inc.php file like so :
      <?php
      
      // Role Control
      
      // Role 2 = Editors
      mm_hideTabs('settings,meta,preview', '2', '');
      mm_hideFields('alias,menutitle,longtitle,link_attributes,introtext,parent', '2');
      mm_hideSections('access', '2', '');
      mm_renameSection('tvs', 'Document extra content', '2');
      
      // General Template Control
      
      // tpl 5 = Home Page
      mm_hideTemplates('5', '2');
      
      // Product Template Control
      
      // tpl 8 = Product Pages
      mm_hideFields('content', '2', '8');
      mm_renameField('description', 'Range name', '2', '8');
      mm_renameSection('tvs', 'General product details', '2', '8');
      
      // tpl 11 = Product Your Speaker Pages
      mm_hideFields('tvproduct_detail_img,tvheader_img', '2', '11');
      mm_hideSections('tvs', '2', '11');
      mm_renameSection('content', 'Your Speaker details', '2', '11');
      
      // tpl 12 = Product Reviews Pages
      mm_hideFields('tvproduct_detail_img,tvheader_img', '2', '12');
      
      // tpl 13 = Product Technology Pages
      mm_hideFields('tvproduct_detail_img,tvheader_img,content', '2', '13');
      mm_renameSection('tvs', 'Technologies of product', '2', '13');
      
      // tpl 14 = Product Specification Pages
      mm_hideFields('tvproduct_detail_img,tvheader_img', '2', '14');
      mm_hideSections('tvs', '2', '14');
      mm_renameSection('content', 'Specification details', '2', '14');
      
      // tpl 15 = Product Finishes Pages
      mm_hideFields('tvproduct_detail_img,tvheader_img,content', '2', '15');
      mm_renameSection('tvs', 'Finishes of product', '2', '15');
      
      // tpl 16 = Product Brochure Pages
      mm_hideFields('tvheader_img,content', '2', '16');
      mm_renameSection('tvs', 'Brochure for product', '2', '16');
      
      // Dealer Template Control
      
      // tpl 9 = Dealer Detail Pages
      mm_hideFields('content,show_in_menu,menuindex', '2', '9');
      mm_renameField('pagetitle', 'Internal name', '2', '9');
      mm_renameField('description', 'Dealer name', '2', '9');
      mm_renameSection('tvs', 'Dealer details', '2', '9');
      
      ?>
      • @bunk58
        Quote from: bunk58 at Mar 09, 2009, 07:26 PM

        As you’ve seen before, I tend to use the mm_rules.inc.php file like so :

        Definitely, clean and well documented code as in your example is extremely useful. I’d consider it the first line of defence against rule-vertigo. I just found after a few times out that I could work faster against a slightly more visual reference, even with a well organized and commented rule set. The spreadsheet initially came out of me planning out the MM changes on paper. Maybe overkill for most people. Maybe I should up my ginko dosage?

        (For you younger MODxers, paper is defined here: http://en.wikipedia.org/wiki/Paper)
          Mike Schell
          Lead Developer, MODX Cloud
          Email: [email protected]
          GitHub: https://github.com/netProphET/
          Twitter: @mkschell