We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24643
    • 4 Posts
    Hi there,

    I’ve been using drupal and modx for different jobs/projects. I generally prefer modx (modx fan), but there’s one (very important) feature missing in template variables which makes me think of drupal’s cck (content construction kit) as the better and more flexible solution. When editting a document in modx, it’s not possible to add multiple values to a template variable (not even in revolution)! In drupal, you can create a cck field, let’s say a date, for a content type and define how many values the user may enter for that field. For example, if you create an event, the event may have more than one date. In that case, drupal’s cck displays a "add another item" button, which dynamically (ajax) adds a second (and third...) date field to the content. You can set a limit for how many entries a field may have. In modx, if you want to offer your users the possibility of entering a maximum of 10 dates for an event, you actually have to create 10 template variables for a date and they will all appear in the manager (empty fields, most of the time). This is really not very handy and adds a lot of confusion to the interfase.

    If you ask me, I would really like to have this feature in modx. And if you really want to make modx more flexible, I would also add the feature of creating tv groups, and allow multiple entries for groups. In that case it would be easy to create a set of two tvs, for example a date and a venue field, group them together, and give users the possiblity of entering as many date and venue pairs as they want. This feature would make modx even more flexible than drupal’s cck.

    I also think there should be a tutorial for how to add new tv definitions. It would be nice if I can write a plugin for a new tv definition and add it to my modx installation. We could publish and download our tv definitions!

    This features would make it much easier for me to choose modx over drupal and other systems.

    thanks a lot for for your time and keep up the good work!

    cheers,

    rodrigo



    • FYI, you can create custom TV types and widgets in Revolution. We’ll publish some documentation on this soon.
        • 4971
        • 964 Posts
        WOW!! that makes TVs even better... amazing!! and congrats...
          Website: www.mercologia.com
          MODX Revo Tutorials:  www.modxperience.com

          MODX Professional Partner
          • 24643
          • 4 Posts
          Aditionally, it would be nice to add template variables to user profiles. If you need an extra field, which the standard modx user profile doesn’t have, you could create a tv and asign it to the user profile or perhaps to a specific user group. I know there’s a snippet in evolution for custom user profiles (webloginpe), but it doesn’t work with the modx manager. Any extra field you create with this snippet is only accesible through php code or directly in mysql (phpmyadmin).
          I have a customer who demanded the "full name" field to be split in name and surname. He also wanted to have extra fields, like "company" and "title". I had to use webloginpe and also write a complete user manager module for him to be able to access and edit those extra fields. If you could create tvs for user profiles, this would be a peace of cake and you would not be required to use snippets like webloginpe. And most important, you would be able to access and edit the values for those extra profile fields from within the modx manager. I would also build the standard modx user profile out of tvs, so if somebody wants to erase a field, and add another, it could be accomplished in a few minutes. This way I would erase the "full name" field and add one for "name" and "surname" without problems.

          cheers,

          rodrigo
          • Quote from: rdrg at Oct 10, 2009, 12:53 PM

            Aditionally, it would be nice to add template variables to user profiles. If you need an extra field, which the standard modx user profile doesn’t have, you could create a tv and asign it to the user profile or perhaps to a specific user group. I know there’s a snippet in evolution for custom user profiles (webloginpe), but it doesn’t work with the modx manager. Any extra field you create with this snippet is only accesible through php code or directly in mysql (phpmyadmin).
            First, Template Variables are tied to Templates and Resources and would have nothing to do with, User Profiles. What you are really asking for is a better custom User Profile component that includes Modules in the manager to manage the additional User Profile data you define. It’s up to contributors to create these things, and this usually only happens if someone pays contributors for that development and allows them to contribute it back to the community. Quid pro quo!

            Quote from: rdrg at Oct 10, 2009, 12:53 PM

            I would also build the standard modx user profile out of tvs, so if somebody wants to erase a field, and add another, it could be accomplished in a few minutes. This way I would erase the "full name" field and add one for "name" and "surname" without problems.
            Second, adding and removing custom fields like this is not a trivial thing and the Template Variable approach complicates data access/reporting (especially if you start storing multiple values per TV); IMO, the goal here should rather be a custom data model editor that allows non-developers to add custom data objects and administration forms to the manager easily. This is where we are heading with Revolution. The Template Variable-style data model is useful for some things but I do not think it is scalable or flexible enough in the long-term here; providing a UI for creating and managing custom data models in the MODx manager however would be, and would make the solution more useful to both developers and non-developers alike.
              • 24643
              • 4 Posts
              Thanks for you reply.

              I guess that "providing a UI for creating and managing custom data models" would be the best solution. Not only for non-developpers. I still have to understand better the structure of revolution, but if I get paid for a job involving this features and therefore have time enough to contribute with this functionality, I will.

              best,

              rodrigo
                • 14368
                • 56 Posts
                I know this is an old topic, but I’ve also been searching for days now for any tips in creating TVs with multiple values and this is the closest I came. I want my users to be able to create a list of regular events happening at their church, and the only way I could find to do it was to manually create 10 separate custom event TVs, which they may or may not (probably not) use all of. Now on to the task of hiding the empty ones with CSS/Javascript until they’re wanted ...
                Is there a better way of doing this?
                  • 14368
                  • 56 Posts
                    • 41958
                    • 65 Posts
                    Hi, saw you have som experience in template variables and also in drupal.
                    Can you tell me, how to achieve in drupal this:
                    I would like to add another content to each node - a simple page to display something different.
                    I have created this but instead of showing this under or above the body area I would like to have it display on the side. I managed also this but now I have two instances of this field.
                    How can I delete the one under the main text area?

                    thx
                    • This is a very old post; the solution is to be found in the MIGx TV add-on. http://rtfm.modx.com/display/ADDON/MIGXdb.Manage+Events-Resources+in+a+CMP+with+help+of+MIGXdb
                        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