We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 727
    • 502 Posts
    Typically in the sites I develop there are subsections that use different templates. For example there may be a project section where all the pages are children of a main "Project" page. In order to create a new project page the user has to:

    1. Create a new document with the Project page as the parent
    2. Set the template of the document to the "project page template".

    Here is my idea:

    1. A plugin for the manager that add a new set of links somewhere.
    2. The links are items like "create a new project page"
    3. When the link is chosen it will create a new blank page with a specific template and a specific parent.

    For example, I could configure the plugin with:

    "Project Page": Parent ID = 4, Template = "Project Page Template"

    Then I would be able to tell my users to just click on the "create a new project page" link.

    So, my questions are:

    1. Does my idea have any value?
    2. Can it be implemented in 0.9.6 as a plugin without changes to MODx itself? If so how?

    Andy
      • 27376
      • 576 Posts
      This is a great idea. I did something similar by creating a module that allowed my users to create documents, and when they click "save", it would automatically save under a specific parent with a specific template.

      Unfortunately, I can’t share much of it because code I write when I’m on the clock isn’t legally my own undecided and therefore it’s not opensource.

      But your answer is going to be in a module. Not a plugin. And currently, modules are a hassle to write...
        • 34017
        • 898 Posts
        Would FDM work for this? Or I would think eForm, DocManager snippet might do it.
          Chuck the Trukk
          ProWebscape.com :: Nashville-WebDesign.com
          - - - - - - - -
          What are TV's? Here's some info below.
          http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
          http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
          • 727
          • 502 Posts
          FDM looks nice but I don’t think it makes much sense to tell the end user to add some pages using the manager and others using the website. I really don’t want to reimplement a lot of the manager functionality using an FDM type system.

          Maybe a future version of MODx can include the concept of user-definable "document types" where the parent, template and default TV values are specified?

          One problem I have with the current modules interface is that it is isolated from the rest of the manager. I would prefer to add something near the document tree toolbar, but I think that kind of flexibility for the manager is already planned.

          I’ll look into writing a module - thanks.

          Andy
            • 34017
            • 898 Posts
            My bad. I thought you wanted something to do on the frontend.

            For the manager, you could check out the current plugin that has "use same template as parent". You could probably add a plugin to say "if user == ’certain user’, then make parent id ’4’ and template ’Project Page Template’. You could then use create different defaults that could be overridden if needed.

            Would that seem to work or do you want something more complicated?
              Chuck the Trukk
              ProWebscape.com :: Nashville-WebDesign.com
              - - - - - - - -
              What are TV's? Here's some info below.
              http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
              http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
              • 727
              • 502 Posts
              Thanks for the ideas - I’ll take a look. smiley

              Andy