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

    I was wondering why nobody complained about this before.

    Today, I got a *complaint* from one of our content managers( who started working with the modx manager for the first time):

    Hey said:
    "When I select the NEWS node, and I press ’new document’ from the top menu (or from the new document icon)
    Why doesn’t the new document have NEWS as parent??"

    I explained that he can accomplish this only when he uses the context-menu via right-clicking the node

    After this explanation the user was satisfied, but I understood the complaint and
    I too agree that it’s kind of unlogical that the ’new document’ action behaves differently from the context-menu.


    So I made a little hack in the core, it works nice and it might be a usefull addition.
    (using the selectedObject javascript variable, which was in the code already but never used!)


    ----------------------------------
    FILE: manager/frames/tree.php
    ----------------------------------

    ADDED:
    line 324: selectedObject = id;

    CHANGED:
    search for the line:

    <td><a href="#" class="treeButton" id="Button3a" onclick="top.main.document.location.href=’index.php?a=4’;"

    and change it to:

    <td><a href="#" class="treeButton" id="Button3a" onclick="top.main.document.location.href=’index.php?a=4&pid=’ + selectedObject;"

    ----------------------------------
    FILE: manager/frames/menu.php
    ----------------------------------

    CHANGED:
    search for the block:

    if ($modx->hasPermission(’new_document’)) {
    // new-document
    $sitemenu[] = ’<li><a onclick="this.blur();" href="index.php?a=4" target="main">’.$_lang[’add_document’].’</a></li>’;
    // new-weblink
    $sitemenu[] = ’<li><a onclick="this.blur();" href="index.php?a=72" target="main">’.$_lang[’add_weblink’].’</a></li>’;
    }

    and change it to:

    if ($modx->hasPermission(’new_document’)) {
    // new-document
    $sitemenu[] = ’<li><a href="#" onclick="this.blur();top.main.document.location.href=\’index.php?a=4&pid=\’ + top.tree.selectedObject;">’.$_lang[’add_document’].’</a></li>’;
    // new-weblink
    $sitemenu[] = ’<li><a href="#" onclick="this.blur();top.main.document.location.href=\’index.php?a=72&pid=\’ + top.tree.selectedObject;">’.$_lang[’add_weblink’].’</a></li>’;
    }




      • 7455
      • 2,204 Posts
      That looks nice but could also be not logical when browsing tru the tree you could have selected a doc that is not the parent you want the new doc to be in.
      Better would be a screen that lets you select the parent when you klick the new doc icon.

      Dimmy
        follow me on twitter: @dimmy01
        • 2842
        • 2 Posts
        Dimmy,

        Logical might be personal here grin

        In almost every system (ie. Windows Explorer / Mac / Linux etc.), when you are browsing a folder tree and click new document or new folder from the menu it will be created under the selected folder.

        For me personally it is a valueable addition, it’s annoying that documents are placed directly under the root upon creation when you forget to select the correct parent in the new document form. (especially since auto-publish is active on my site, so additionally the top menu is immediately screwed up that way :-S)

        IMHO the "screen that lets you select the parent" which you suggest is too much, because you can select the parent node within the new document form.

        Anyway, thx for your feedback, I hope it’s usefull for other people. wink

        Grtz,
        Bas



          • 20413
          • 2,877 Posts
          Tough call, must say its even!  :D

          When clients get use to it and see how easy they can change parent for a doc. Its all good.
          Though the clients are the ones who pay money!

          So I will bookmark this until that customer! THANKS!  :)
            @hawproductions | http://mrhaw.com/

            Infograph: MODX Advanced Install in 7 steps:
            http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

            Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
            http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
            • 7231
            • 4,205 Posts
            This could be interesting. I have also bookmarked for future reference. Thanks. grin
              [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

              Something is happening here, but you don&#39;t know what it is.
              Do you, Mr. Jones? - [bob dylan]
            • I think I really like BasQue’s suggestion. smiley
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • It’s a nice idea - could always have a system config setting to define the behaviour - that would cater for both sides of the camp.
                  Garry Nutting
                  Senior Developer
                  MODX, LLC

                  Email: [email protected]
                  Twitter: @garryn
                  Web: modx.com
                  • 34162
                  • 1 Posts
                  Would it be rude to suggest that posts should indicate the version it is relating to?

                  I do so much searching this forum and most of the posts I find are not reflecting to my MODx version 1.0.2 Just like this one. It is, may I kindly cite my selfish nature then, a bit annoying to have read through one entire post, made notes and then trying to follow some suggestions, only to realize... this has nothing in common with my version.

                  I’ve been there now dozens of times and start thinking about, how much could I have advanced in understanding MODx if actually what I read would only apply! (my version in mind, of course)

                  Thanks a lot for your understanding
                  • Quote from: zeroge at Feb 28, 2010, 12:54 PM

                    Would it be rude to suggest that posts should indicate the version it is relating to?

                    I do so much searching this forum and most of the posts I find are not reflecting to my MODx version 1.0.2 Just like this one. It is, may I kindly cite my selfish nature then, a bit annoying to have read through one entire post, made notes and then trying to follow some suggestions, only to realize... this has nothing in common with my version.

                    I’ve been there now dozens of times and start thinking about, how much could I have advanced in understanding MODx if actually what I read would only apply! (my version in mind, of course)

                    Thanks a lot for your understanding
                    You can thank me but I don’t understand, because this should apply to all 0.9.x/1.0.x releases, collectively known as Evolution, including the 1.0.2 version you are speaking of. huh

                    Sometimes posts will be related to MODx in general, sometimes to Evolution, sometimes to Revolution, and sometimes a specific revision of either. We try to keep the posts here organized as best we can, but feel free to volunteer to help us do that or work on official documentation efforts so searching the forums is not as critical in the first place.