<![CDATA[ Form Customization Improvement Suggestions - MODX Community Forums]]> https://forums.modx.com/thread/?thread=29865 <![CDATA[Re: Form Customization Improvement Suggestions]]> https://forums.modx.com/thread/29865/form-customization-improvement-suggestions?page=4#dis-post-527734 whats up with this feature? Can this (natively) be done in Revo 2.3.3? I am really tired of duplicating dozens of customization sets.. I would love being able to use comma separated values. I also tried OCDCoders suggestion from page #3, but without luck sad]]> aaantz Jul 01, 2015, 06:39 AM https://forums.modx.com/thread/29865/form-customization-improvement-suggestions?page=4#dis-post-527734 <![CDATA[Re: Form Customization Improvement Suggestions]]> https://forums.modx.com/thread/29865/form-customization-improvement-suggestions?page=4#dis-post-436319


  • Create your own github account
  • Create a fork of MODX by clicking on the fork button at the MODx repo
  • If on Windows, do this so your line endings won't cause trouble: git config --global core.autocrlf true
    [li]Clone your fork with git clone -- you'll be on your master branch: git clone git@github.com:yourGitUsernameHere/revolution.git modx
  • You need two remotes, origin (your fork) should already exist. Create a second called upstream pointing to the MODX repo:
  • git remote add upstream http://github.com/modxcms/revolution.git
  • Create a tracking branch that tracks the MODx repo:
    [li] git fetch upstream
  • git checkout -b develop upstream/develop
  • Just before making any changes, update your local develop branch (be sure you're on that branch):
  • git fetch upstream develop
  • git merge --ff-only upstream/develop
  • Create a branch to work on your contribution (e.g., git checkout -b mycode)
  • Make your changes.
  • Make sure your changes are staged (git add . ) -- note the dot
  • Commit your changes with a comment (e.g., git commit -a -m "Here's what I did")
  • Type git status to make sure everything got committed
  • Just before issuing your pull request, update again, but like this:
  • git fetch upstream develop
  • git rebase upstream/develop (rebase will tack your changes on to the end of any MODX changes)
  • Push your new branch to your fork (git push origin mycode)
  • Go to the modx repo at GitHub and make a pull request to pull your mycode branch into the MODx dev branch
  • Have a beer


Never merge your own changes into the develop branch and never make changes in that branch yourself. If you do, and MODX uses your pull request, your changes will be in there twice when you update develop and future pull requests from you will be very difficult to use.

For future pull requests, switch to your develop branch (git checkout develop), update it with fetch/merge and create a *new* branch to work following the steps above from that point on.

Optional: You can remove the unnecessary local branches and unnecessary branches at your fork (e.g., master, release 1.1, etc. This will free up disk space and cut down on the clutter. Be sure not to delete the develop branch.

This will show you all the local branches: git remote
This will show you the remote branches: git remote -r

remove local branches with: git branch -D branchname
remove remote branches at your fork with: git push origin :branchname


------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone: http://bobsguides.com/modx.html]]>
BobRay Sep 07, 2012, 07:50 PM https://forums.modx.com/thread/29865/form-customization-improvement-suggestions?page=4#dis-post-436319
<![CDATA[Re: Form Customization Improvement Suggestions]]> https://forums.modx.com/thread/29865/form-customization-improvement-suggestions?page=4#dis-post-436266
I have a list a mile long of things I want to submit and add-ons I want to make. Problem is I usually end up doing stuff like the above (or all those changes I did to Newspublisher) as part of big projects, and then the next big project comes along...

Anyone is welcome to grab that and submit it if they want, I don't need my name on it. Or I'll try to get it together enough to finish setting up my development environment here so I can finally contribute. It is Friday, after all. ;-)

(I actually had a dream last night about an alternate method for form customization that (to me) would be much simpler and less confusing. I don't think I need to be working Friday nights, I think I need a nice long vacation!)]]>
ocdcoder Sep 07, 2012, 10:28 AM https://forums.modx.com/thread/29865/form-customization-improvement-suggestions?page=4#dis-post-436266
<![CDATA[Re: Form Customization Improvement Suggestions]]> https://forums.modx.com/thread/29865/form-customization-improvement-suggestions?page=4#dis-post-436219

------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone: http://bobsguides.com/modx.html]]>
BobRay Sep 06, 2012, 09:50 PM https://forums.modx.com/thread/29865/form-customization-improvement-suggestions?page=4#dis-post-436219
<![CDATA[Re: Form Customization Improvement Suggestions]]> https://forums.modx.com/thread/29865/form-customization-improvement-suggestions?page=3#dis-post-436212
$template = $rule->get('template');
if (!empty($template) && $template != $resource->get('template')) {
  continue;
}

I added code after it. (Above code included for reference.)
$template = $rule->get('template');
if (!empty($template) && $template != $resource->get('template')) {
    continue;
}

// CB: Also check constraints (allows for multiple constraints)
$constraintClass = $rule->get('constraint_class');
if (!empty($constraintClass)) {
    if (empty($resource) || !($resource instanceof $constraintClass)) continue;
    $constraintField = $rule->get('constraint_field');
    $constraint = $rule->get('constraint');
    $constraintList = explode(',', str_replace(' ', '', $constraint));
    if (($resource->get($constraintField) != $constraint) && (!in_array($resource->get($constraintField), $constraintList))) {
      continue;
    }
}


Like the above, probably needs more testing, but I think this is a good time to be done for the evening. smiley]]>
ocdcoder Sep 06, 2012, 06:56 PM https://forums.modx.com/thread/29865/form-customization-improvement-suggestions?page=3#dis-post-436212
<![CDATA[Re: Form Customization Improvement Suggestions]]> https://forums.modx.com/thread/29865/form-customization-improvement-suggestions?page=3#dis-post-436210
Revo 2.2.4, /core/model/modx/modmanagercontroller.class.php, Starting at line 778, I changed:
if ($obj->get($constraintField) != $constraint) {
  continue;
}

to:

// CB: Allow comma-separated lists of constraints
//if ($obj->get($constraintField) != $constraint) {
//    continue;
//}
$constraintList = explode(',', str_replace(' ', '', $constraint));
if (($obj->get($constraintField) != $constraint) && (!in_array($obj->get($constraintField), $constraintList))) {
	continue;
}

That seems to be working like expected. So far...

I did run into another issue. I have one set of rules for a specific template with no constraints, then another for that same template with constraints. It's applying the right rules, comma-separated or not, except that I'm setting a value for one of the TVs in the set with the constraints and it's still changing the value for resources that don't match the constraints. It doesn't matter what the constraints are, it's applying it to everything unless I change the template.

It's not outputting it as one of the rules, it's setting the TV directly. So now I just need to figure out where that little bit of fun is coming from.]]>
ocdcoder Sep 06, 2012, 06:42 PM https://forums.modx.com/thread/29865/form-customization-improvement-suggestions?page=3#dis-post-436210
<![CDATA[Re: Form Customization Improvement Suggestions]]> https://forums.modx.com/thread/29865/form-customization-improvement-suggestions?page=3#dis-post-436192
Revo 2.2.4, /core/model/modx/modmanagercontroller.class.php, Starting at line 778, I changed:
if ($obj->get($constraintField) != $constraint) {
  continue;
}

to:

Edit: To something that apparently isn't working right after all. Um, I'll get back with you.]]>
ocdcoder Sep 06, 2012, 04:59 PM https://forums.modx.com/thread/29865/form-customization-improvement-suggestions?page=3#dis-post-436192
<![CDATA[Re: Form Customization Improvement Suggestions]]> https://forums.modx.com/thread/29865/form-customization-improvement-suggestions?page=3#dis-post-436068 michalski Sep 06, 2012, 03:29 AM https://forums.modx.com/thread/29865/form-customization-improvement-suggestions?page=3#dis-post-436068 <![CDATA[Re: Form Customization Improvement Suggestions]]> https://forums.modx.com/thread/29865/form-customization-improvement-suggestions?page=3#dis-post-161904 Quote from: timharris777 at Dec 28, 2010, 04:50 PM

2.- When moving TVs from their current tab to the first tab that appears, the placement of the form fields look awful. Nothing is in line. The TV description will be on one line and the input field below it. The input fields are not nicely lined up. This also looks very sloppy to clients.

I was annoyed with this too. Sure it’s a cosmetic thing but it does look sloppy! See image attached.

Using firebug the element affected is:
input#tv1.textfield.x-form-text.x-form-field


The width of this field is set to 97% which is too wide to keep it on the same line as the label.
Reducing to 95% was enough to keep it on the same line for me but it still stretched much wider than the other resource fields.

I did notice that the resource fields are styled with pixel width values (that change when the window is resized). Would be nice to have the TVs aligned with those if this isn’t being addressed already. Bug filed smiley]]>
okyanet Apr 25, 2011, 08:51 AM https://forums.modx.com/thread/29865/form-customization-improvement-suggestions?page=3#dis-post-161904
<![CDATA[Re: Form Customization Improvement Suggestions]]> https://forums.modx.com/thread/29865/form-customization-improvement-suggestions?page=3#dis-post-161903

  • Moving standard (non-tv) resource fields to different tabs. Say I wanted to move pub_date to the modx-resource-settings tab. Is it currently possible to do this?
  • What about the Resource Content field, could that be moved into a tab? Or could other fields be moved out of a tab and into that ’general content’ area below the Resource Content field?

]]>
okyanet Apr 02, 2011, 11:26 AM https://forums.modx.com/thread/29865/form-customization-improvement-suggestions?page=3#dis-post-161903