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

    I think I’ve found an easy way to do this but I’m wondering if it would be possible to have this as a configurable option somewhere.
    Basically at the start of a project you usually set up all the core pages and these will show in menu so the checked by default is fine.
    Later on when your just adding content within sections (news items, events etc...) these will not be shown in the menu so you/clients need to keep remembering this.
    So perhaps from the Doc manager there could be an option set the default to unchecked for a document and it’s children (or something simillar)

    Anyway here’s how I’ve done it.
    1. Set the default for the hidemenu field in the database (modx_site_content table) to 1 instead of 0
    2. In manager/actions/mutate_content.dynamic.php around line 631 change:
    <?php echo $content['hidemenu']!=1 ? 'checked="checked"':''; ?> onclick="changestate(document.mutate.hidemenu);" /><input type="hidden" name="hidemenu" class="hidden" value="<?php echo ($content['hidemenu']==1) ? 1 : 0 ;?>


    ---to---
    <?php echo ($content['hidemenu']!=1 && $content['hidemenu']!='') ? 'checked="checked"':''; ?> onclick="changestate(document.mutate.hidemenu);" /><input type="hidden" name="hidemenu" class="hidden" value="<?php echo ($content['hidemenu']==1 || $content['hidemenu']=='') ? 1 : 0 ;?>


    You should find that when creating new docs the show in menu is unchecked - other than that the show in menu should work as normal.
    If people have problems with this please let me know as I plan to use this in a live environment so it needs to work.

    James



      • 26435
      • 1,193 Posts
      Nice work james.
      Glad you got it figured out.

      -sD-
      Dr. Scotty Delicious, Scientist.
        Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
        All of the above... in no specific order.


        I send pointless little messages