We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34162
    • 1 Posts
    Hello.

    Is it possible to change the default structure of the manager file menu.

    My version: 0.9.1 uses the pagetitle as the default shown in the document structure.

    Can this be changed to use any of the following:

    • Description
    • Long Title
    • Menu Title

    If so, in which document do I have to make the changes?

    Thanks for the help!!
      • 10487 MODX Staff
      • 1,535 Posts
      Hi gsx750r,

      You will need to look in the 3ldr.php (found in manager/frames/) - there is a SELECT query in this file that retrieves the information necessary for the document tree to be rendered:
      $sql = "SELECT DISTINCT sc.id, pagetitle, parent, isfolder, published, deleted, type, menuindex, hidemenu, alias, contentType, privateweb, privatemgr 
      				FROM $tblsc AS sc 
      				LEFT JOIN $tbldg dg on dg.document = sc.id
      				WHERE (parent=$parent) 
      				AND ($access) 
      				ORDER BY $orderby";
      


      You will need to change the ’pagetitle’ reference to the field you wish to retrieve in its place (don’t change the order of the fields in the query, as the order is important)

      I would like to say I don’t wholly recommend changing the displayed field as pagetitle is the only required field when adding a page, you could end up with blank entries in the document tree if you change it to anything other than pagetitle. But, I’ll leave that decision to you ... just thought I’d mention it smiley

      Have fun,
      Garry
        Garry Nutting
        Senior Developer
        MODX, LLC

        Email: [email protected]
        Twitter: @garryn
        Web: modx.com
        • 34162
        • 1 Posts
        Thanks Garry.

        pagetitle is the only required field when adding a page

        Is it possible to change this attribute to add others?

        Im not a PHP programmer but a friend of mine is, if I know where the relevant info is then I can get him to take a look.

        Cheers
          • 10487 MODX Staff
          • 1,535 Posts
          Is it possible to change this attribute to add others?
          Well, you could check out save_content.processor.php (found in manager/processors) - this is where the documents are processed for saving/updating.

          At the moment, any document with a blank pagetitle would get a default pagetitle of ’Untitled Document’. You could perhaps amend the processing to include similar defaults for the fields you mentioned in your first post.

          Hope that helps,
          Garry
            Garry Nutting
            Senior Developer
            MODX, LLC

            Email: [email protected]
            Twitter: @garryn
            Web: modx.com
            • 34162
            • 1 Posts
            Thanks for that Garry.

            You seem to be having a long night as well.

            Just been on your site and realised that you are also here in rainy UK.

            Well im off to bed now.

            Thanks again for your help, much appreciated.
              • 10487 MODX Staff
              • 1,535 Posts
              Yeah, I’m a first-grade insomniac ... lol! Glad I could help anyway. smiley
                Garry Nutting
                Senior Developer
                MODX, LLC

                Email: [email protected]
                Twitter: @garryn
                Web: modx.com