We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27805
    • 12 Posts
    Hi all. Got into modx about 3 weeks ago and I’ve already got it implemented in a new client site (my personal site will follow).

    One issue I encountered at the last hurdle though.

    As I was setting up different roles etc at the end, I made a lot of form customizations. Basically hiding fields as per the template the resource was using. I created 2 rules. One for the update and one for the create. The update works fine, but when I create a new resource it seems that all of the "hide" rules are being applied to the basetemplate. Then if I switch the basetemplate to another, the fields don’t become visible.

    Now If I create a resource under a folder via the right click->create document here, it will inherit the parent template and the rules will be applied. But yet again, if I change the template, the form customization rules have no affect.

    Anyone else experience this? I’d like to keep things very simple for my clients, and this is confusing the hell out of them.

    Information:
    Revo 2.0.3 Traditional
    Linux server
    php 5.2.14
    mysql 5.0.91
    pdo_mysql is installed
    Using Chrome 6.0
    Windows XP SP3
      • 3749
      • 24,544 Posts
      You can set the default_template System Setting to make the desired template the one that’s used for new documents. You can also set a default_template user setting if you want a particular template to be used for certain users (including the admin Super User).

      If you’re changing templates often, it might make sense to create the Form Customization rules for all of them.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 27805
        • 12 Posts
        I get what you’re saying Bob, but what I mean is if I have a default template selected and change it to another which has a form rule applied to it (say hide longdesc), the longdesc is still showing up.

        Are you suggesting that I create a rule that says the value should be visible for every other template via a rule? That seems arduous.
          • 3749
          • 24,544 Posts
          If I’m understanding you correctly, that sounds more like a cache issue (MODx cache or browser cache). If it still occurs after clearing the caches (and maybe trying from another browser), it sounds like a bug to me.

          You’re not regularly changing the default template as part of your normal workflow are you? If so, there’s probably a better way to accomplish what you’re doing.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 27805
            • 12 Posts
            Quote from: BobRay at Oct 11, 2010, 12:54 AM

            If I’m understanding you correctly, that sounds more like a cache issue (MODx cache or browser cache). If it still occurs after clearing the caches (and maybe trying from another browser), it sounds like a bug to me.

            You’re not regularly changing the default template as part of your normal workflow are you? If so, there’s probably a better way to accomplish what you’re doing.

            I’ve exhausted cache cleaning and browser testing. I’m fairly sure it’s a bug.

            It’s basically for the client. If they go to create a new resource and change the template I wanted certain fields to show/hide depending on the template, because for certain documents the default fields are redundant and confusing for them.

            What would be a better way to accomplish this?
              • 28449
              • 8 Posts
              I’ve encountered some similar problems
              What I want to achieve:
              The website-editor can change some pictures (each picture is placed as TV in a Document under a parent Resource)
              now I want to make it easier for the editor, so only things he/she have to change is visible in a new document.


              When I create a new document under one parent resource
              in tab ’Create/Edit Document’ i want :

              to change the "template" (the one default is for the parent documents so I want here a different one to be set as default)
              (i can’t find how to change the template and hide it, it seams not to be in the List of FC-Resource (http://rtfm.modx.com/display/revolution20/FC-Resource))
              to give the fields ’Hide From Menus’ and ’Published’ a default value of 1
              (i have to make 2 different rules - with hidemenu,published (comma-separated) it doesn’t work on 1 rule)
              to hide the follow : (for the hidemenu and published this must be afterwords - looks normal to me)
              "Content", "template" (can’t hide?), "Long Title", "Resource Alias", "Link Attributes", "Summary (introtext)", "Parent Resource" (can’t hide?),"Published" and "Hide From Menus"

              in tab ’Page Settings’ i want:
              to give the fields "Rich Text", "Searchable", "Cacheable" and "Empty Cache" a default value of 0
              (again this only works when I make separated rules - in stead of one rule using these names as a separated comma)

              in tab "Template Variables" I want: to move my TV (under Template Variables) to "Create/Edit Document", but than I have to first change the "Used Template", I still can’t : see above)

              and last I want to hide the following tabs : "Page Settings", "Template Variables", "Access Permissions"
              (don’t know why, but hiding these tabs doesn’t work - even so if i use different rules for them)


              On this way this all works! Great! (except "Parent Resource" & "Uses Template" - can’t hide these, except moving my TV to 1th tab, and ... read on)
              But why I see first a normal Document and after a while changing to the Document I want (with fields hided),
              can’t this all be done before the new Document has been created?
              Why it doesn’t all work with "separated comma"-names (less rules to create, and makes it more easily to make update rules)


              Here you can see the source-view (probably only for the rules that worked):

              <script type="text/javascript">Ext.onReady(function() {
              Ext.getCmp("modx-panel-resource").getForm().findField("hidemenu").setValue("1");
              Ext.getCmp("modx-panel-resource").getForm().findField("published").setValue("1");
              Ext.getCmp("modx-panel-resource").getForm().findField("searchable").setValue("0");
              Ext.getCmp("modx-panel-resource").getForm().findField("cacheable").setValue("0");
              Ext.getCmp("modx-panel-resource").getForm().findField("syncsite").setValue("0");
              Ext.getCmp("modx-panel-resource").getForm().findField("richtext").setValue("0");
              Ext.getCmp("modx-panel-resource").hideField(["modx-resource-content","longtitle","introtext","alias","link_attributes","published","hidemenu"]);
              });</script>


              and after all, when I create a new document (right-mouse menu on resource-tree) there is still a "quick-create" menu who gives me again a normal document!
              Does somebody know how I can hide this "quick-menu"?