ModxI was working on a site this morning and came across a little tip with the ManagerManager snippet that I thought would be worth sharing.

Whenever I set up a Template Variable (TV) I often wish that I could move the TV fields up above the content area inside the Edit Resource page. If there are just one or two TV fields I feel like the end user won’t always scroll all the way down to see the additional fields below.

What I have noticed is that when using the ManagerManager mm_moveFieldsToTab function, the fields will reorder based on their order inside of the actual function call. So, if you identify the general tab and state your fields (even the standard, default fields) in the order you would like them they will display accordingly. See example below:

mm_moveFieldsToTab('pagetitle,description,longtitle,tvnewsImage,content', 'general');

Note

Please see the post comments that there may be an inconsistency with this technique, at least with the placement of the menuindex field.


View Comments on “Reorder General Tab with ManagerManager”

You can track this conversation through its atom feed.

  1. Michael van Laar says:

    Great tip, Greg. Thanks a lot for sharing. That's exactly what I was searching for weeks now and could not find a proper answer.

  2. Jason Imani says:

    Very cool…I've wondered about this as well…thanks! Very helpful…

  3. Michael van Laar says:

    Today I tested this and it works great, but I’m facing one little problem: After “reordering” fields, the menuindex field is always displayed on top of all other fields – no matter where I place it in the function call.

    The function call itself looks like this (whereas “download-file” is one of my template variables and the rest of the fields is hidden):

    mm_moveFieldsToTab('pagetitle,download-file,template,parent,menuindex', 'general', '', '6');

  4. Gregory Smart says:

    That's interesting, I didn't see that because I was hiding that field from the user anyway. I then use the Module/Doc Manager to order/reorder the pages.

    I was able to replicate what you found. The menu index does move above any field listed in that function, but if you remove a field (like pagetitle, it will move ahead of the menuindex). I am not sure how to classify this behavior (annoying?) since this is not really the intended use of this feature.

    I have sent a note to ncrossland (the snippet author) informing him of this behavior. I will post if I receive any other information on this.

  5. Gregory Smart says:

    This was ncrossland's response:
    ” Hi Greg

    Thanks for sending me the link to the post — very good use of MM, I hadn't thought of it in this way to reorder the fields.

    The menuindex field has always been a little tricky to deal with because it is uses a different layout to most other fields (because it has “show in menu” checkbox alongside it, and the < > controls). I specifically excluded it from working with some functions because it broke the layout badly – I'm not sure if this is the case here. It's nothing that isn't fixable, now I know it's important to people.

    I've filed this as a bug in Jira so I don't forget about it for the next version: http://svn.modxcms.com/jira/browse/EXT-28

  6. shox oz men says:

    Well , the view of the passage is totally correct ,your details is really reasonable and spring-bags.com you guy give us valuable informative post, I totally agree the standpoint of upstairs. I often surfing on this forum when I m free and I find there are so much good information we can learn in this forum!

Leave a Reply

You must be logged in to post a comment.

blog comments powered by Disqus