We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • There's really no reason why manager pages need to be any different from front-end pages. There could either be a separate table for them (manager_content to complement site_content, manager_snippets, manager_chunks, etc), or just use a third resource type ('manager'). The tree would not display 'manager' type resources unless creating/editing 'manager' resources, in which case only the 'manager' type resources would be displayed. Resource types could even be broken out to their own table, corresponding to categories for elements. This would open up whole vistas of possibilities for dealing with elements like TVs by resource type rather than by template, or viewing the Tree or other resource listings by type (along the lines of "articles" in Revo). It would also open up a lot of possibilities for front-end snippets.

    Some versions ago the parser started getting invoked in the manager's index.php file, initially to provide the API functions, but that huge switch in the manager's index.php file could be completely done away with. There's nothing "magic" about the manager, it's just check permissions, get stuff from the database, generate forms. Jot, MaxiGallery, WebLoginPE, and a lot of other front-end add-ons do exactly the same thing, using GET, POST and COOKIE values for controls and filters.
      Studying MODX in the desert - http://sottwell.com
      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
      Join the Slack Community - http://modx.org
      • 19369
      • 1,098 Posts
      @Sottwell, I have tried to integrate elRTE with the Manager theme, but it does not work if it is inside a hidden panel, for example when it's inside a Tab. See the issue here: http://elrte.org/redmine/boards/4/topics/3395.

      I have tried to fix this issue by following the example on that link but it doesn't work yet.
        • 28439
        • 222 Posts
        Quote from: microcipcip at May 14, 2012, 04:48 PM
        What do you think is the best way to integrate grids/tables? I would like to make the tables in the Manager Theme with this excellent jQuery script (it can be integrated with Themeroller for jQuery UI): http://datatables.net/

        Please have a look at jqGrid, it is well developed, uses the Themeroller, and works very well. It does understand JSON calls, which makes it very easy to handle all data calls.

        I'm using jqGrid for some years now and I'm very pleased.
          Gone away and found a better place to stay
          • 19369
          • 1,098 Posts
          Quote from: Stefanie at May 14, 2012, 08:36 PM
          Please have a look at jqGrid, it is well developed, uses the Themeroller, and works very well. It does understand JSON calls, which makes it very easy to handle all data calls.

          I'm using jqGrid for some years now and I'm very pleased.

          Ok, I'll use jqGrid.
            • 19369
            • 1,098 Posts
            This week I have been doing many tests with forms.
            1. Simple Input Text
            2. Simple TextArea
            3. Medium Size TextArea
            4. Big Size TextArea
            5. Checkbox, Inline Checkbox
            7. Radio, Inline Radio
            8. Insert Image
            9. Insert Date
            10. Insert File
            11. TinyMCE
            12. Errors, Disabled fields, Validation
            13. Mixed fields inline
            14. Boxes (to group Tvs) (with some icons that may be useful in the future)
            15. 2Col layouts
            16. Add Remove field (good for integration with plugin like MultiTV)
            17. Position of "description" field for TVs
            18. Text size
            19. And more...


            To see the test, just open the demo and click on each tab.
              • 19369
              • 1,098 Posts
              My main effort was to make the HTML as simple as possible, and use always the same elements. On top of these elements there are some classes that are used to tell the form how to behave.

              Main Container: the main container is a "ol" list, each row is a "li" tag. I have followed a good tut on alistapart for the html markup.
              <!-- [Form Container] -->
              <ol class="form-container">
                   <li>Fields here</li>
              </ol>	
              <!-- [/End Form Container] -->
              


              Basic row structure: the basic structure is composed by two or three divs, the first is the label, the second is a container for the form fields, the third is generally a tooltip or a description. The following is the html for a simple input text field.
              <li>
                   <div class="form-label">Page Title</div>
                   <div class="form-fields">
                        <input type="text" />
                   </div>
                   <div class="form-tooltip" title="Tooltip text here"></div>
              </li>
              


              Textarea:
              <li>
                   <div class="form-label">Summary (Introtext)</div>
                   <div class="form-fields">
                        <textarea rows="4"></textarea>
                   </div>
                   <div class="form-tooltip" title="Text here."></div>
              </li>	
              


              Select:
              <li>
                   <div class="form-label">Uses Template</div>					
                   <div class="form-fields">
                        <select>
                             <optgroup label="default">
                                  <option>Blank</option>
                                  <option>Template 1</option>
                                  <option>Template 2</option>
                             </optgroup>
                             <optgroup label="default 2">
                                  <option>Blank</option>
                                  <option>Template 1</option>
                                  <option>Template 2</option>
                             </optgroup>
                        </select>
                   </div>
                   <div class="form-tooltip" title="Text here."></div>
              </li>
              


              Checkbox:
              <li>
                   <div class="form-label">Show In Menu?</div>
                   <div class="form-fields">
                        <label><input type="checkbox" />Yes</label>
                   </div>
                   <div class="form-tooltip" title="Text here."></div>
              </li>
              


              Inline Checkbox: note the "inline" class, added to the "form-fields" div. Usually this is the only change you'll need, to make a form behave in a different way.
              <li>
                   <div class="form-label">Inline Checkbox</div>
                   <div class="form-fields inline">
                        <label><input type="checkbox" />Yes</label>
                        <label><input type="checkbox" />No</label>
                        <label><input type="checkbox" />Maybe</label>
                   </div>
                   <div class="form-tooltip" title="Text here."></div>
              </li>
              


              Textarea Medium, Textarea Big: here are other two examples, again, I just added the class "big" or "medium" to the label and to the "form-fields" div, and all is handled by CSS
              <li>
                   <div class="form-label">Textarea Medium</div>
                   <div class="form-fields medium">
                        <textarea rows="6"></textarea>
                   </div>
              </li>					
              <li>
                   <div class="form-label big">Textarea Big</div>
                   <div class="form-fields big">
                        <textarea rows="10"></textarea>
                   </div>
              </li>
              



              DatePicker: this is slightly different from the other examples, because there is a button for removing the date.
              <li>
                   <div class="form-label"> DatePicker</div>
                   <div class="form-fields">
                        <div class="form-datepicker">
                             <input type="text" />
                             <input type="button" title="Remove Date" />
                        </div>
                   </div>
              </li>
              


              Insert Image:
              <li>
                   <div class="form-label">Insert Image</div>
                   <div class="form-fields">
                        <div class="form-image">
                             <input type="text" />
                             <input type="button" title="Insert Image" />
                        </div>
                   </div>
              </li>
              


              Multiple fields inline: here is an example useful for building complex applications. The fields itself are always the same, what is important is the additional class to the "form-fields" div, in this case "form-double-inline" and "form-triple-inline", and "form-quadruple-inline".
              <li>
                   <div class="form-label">Double Inline Input Text</div>
                   <div class="form-fields form-double-inline">
                        <input type="text" />
                        <input type="text" />
                   </div>
                   <div class="form-tooltip" title="Text here."></div>			
              </li>	
              <li>
                   <div class="form-label">Triple Inline Input Text</div>
                   <div class="form-fields form-triple-inline">
                        <input type="text" />
                        <input type="text" />
                        <input type="text" />
                   </div>
                   <div class="form-tooltip" title="Text here."></div>
              </li>
              <li>
                   <div class="form-label">Quadruple Inline Input Text</div>
                   <div class="form-fields form-quadruple-inline">
                        <input type="text" />
                        <input type="text" />
                        <input type="text" />
                        <input type="text" />
                   </div>
                   <div class="form-tooltip" title="Text here."></div>
              </li>
              


              Input Button, Link Button:
              <li>
                   <div class="form-label">Link Button</div>
                   <div class="form-fields">
                        <a class="button">Insert long text</a>
                   </div>
              </li>
              <li>
                   <div class="form-label">Input Button </div>
                   <div class="form-fields">
                        <input type="button" value="Insert" class="button" />
                   </div>
              </li>	
              


              2 Columns: for slitting the form into two columns, you can add "form-container-left" and "form-container-right" classes to the main container
              <!-- [Form Container] -->
              <ol class="form-container form-container-left">
                   <li>Fields here...<li>	
              </ol>
              <ol class="form-container form-container-right">
                   <li>Fields here...<li>	
              </ol>
              <!-- [/End Form Container] -->


              Boxes:
              <!-- [Form Container] -->
              <ol class="form-container">			
                   <li class="is-container">
                        <ol class="form-box">
                             <li class="form-box-title">
                                  <p>This is: Box 1</p>
                                  <ul class="form-box-title-actions">	
                                       <li>Collapse, Add, Move Up, Move Down, and Remove actions buttons for this Box</li>										
                                  </ul>
                             </li>						
                             <li>Fields here...</li>	
                             <li>Fields here...</li>					
                        </ol>
                        <ol class="form-box">
                             <li class="form-box-title">
                                  <p>This is: Box 2</p>
                                  <ul class="form-box-title-actions">	
                                       <li>Collapse, Add, Move Up, Move Down, and Remove actions buttons for this Box</li>										
                                  </ul>
                             </li>						
                             <li>Fields here...</li>	
                             <li>Fields here...</li>					
                        </ol>
                   </li>
              </ol>
              <!-- [/End Form Container] -->
              


              Errors:
              <li>
                   <div class="form-label error">Page Title <em>*</em></div>
                   <div class="form-fields error">
                        <input type="text" />
                   </div>
                   <div class="form-tooltip" title="Enter the name/title of the Resource. Avoid using backslashes in the name."></div>
                   <div class="form-description">This is the standard description of the field</div>						
                   <div class="form-description error">And this is an additional text for the error</div>
              </li>
              


              Dynamic Fields buttons (Add/Remove):
              <li>
                   <div class="form-label">Standard Input Text</div>
                   <div class="form-fields"><input type="text" /></div>
                   <div class="form-dynamic-fields">
                        <input type="button" class="form-dynamic-fields-add" title="Add Another Field" />
                        <input type="button" class="form-dynamic-fields-remove" title="Remove Field" />
                   </div>						
              </li>
              


              Validation: see the class "validate[required,custom[email] ]" and "validate[required,custom[email] ]"
              <li>
                   <div class="form-label">Number</div>
                   <div class="form-fields">
                        <input type="text" class="validate[required,custom[number]]" />
                   </div>
                   <div class="form-tooltip" title="Text here."></div>
              </li>
              <li>
                   <div class="form-label">Email</div>
                   <div class="form-fields">
                        <input type="text" class="validate[required,custom[email]]" />
                   </div>
                   <div class="form-tooltip" title="Text here."></div>
              </li>	
              

              • Just out of curiosity, why ol instead of ul?
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                  • 19369
                  • 1,098 Posts
                  It doesn't change anything. I have just followed alistapart tutorial. Here's what the author says:
                  The HTML is fairly simple, but you will notice a few things in the structure. I’m using an ordered list (ol) inside the main fieldset. I’m doing this for two reasons:

                  - I can use each list item (li) as a container for each row in the form, which is handy for styling.
                  - It is, in my opinion, semantically appropriate (i.e. a list of form controls in some kind of logical order).

                  Additionally, the ol provides additional information for some screen readers that announce the number of list-items when they first encounter the list.
                    • 21417
                    • 486 Posts
                    wow, awesome work microcipcip.

                    I really like the TV description below the input, much cleaner.

                    The TV grouping is a nice, looks great.

                    Very nice!

                      Web design Adelaide
                      http://gocreate.com.au
                    • It is interesting to build each functions, after design work.