We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38943
    • 6 Posts
    Hope this is the right place for this question -- I've posted elsewhere with no responses, so apologies for reposting.

    We're trying to figure out how to enable front-end creation of content, using a video-editing tool called butter -- see here for an example of the interface:
    http://popcornmaker.hackinghistory.ca/test/ohm-video-maker.html

    I'd like to let users create the video (actually a 'hypervideo', with dynamic events keyed to the video timeline) and then click a button to save the project data to a modx resource with a couple of custom fields (TV's). Is it possible to do this? If not, is there any way at all to replace the main resource creation interface on the backend with something like this (for those who haven't clicked through, it's a javascript-heavy drag-and-drop editing interface with a layout that would be familiar to users of, say, a nonlinear video editing tool like iMovie)? The idea is to make something that's really easy for users to interface with, andthe default backend is a little unwieldy for those purposes.

    Thanks!

    Matt
    • MODX can do *almost* anything.
      So, what's your obstacle?
        Rico
        Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
        MODx is great, but knowing how to use it well makes it perfect!

        www.virtudraft.com

        Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

        Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

        Maintainter/contributor of Babel

        Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
        • 38943
        • 6 Posts
        well, I guess I have no idea how to start!

        Here's what I imagine we need to do:

        - create a resource which will be the video editing/creation page. In the template for that page, load the whole editing UI that you can see in my link above
        - in that template there will bea "save this project to the website" button. This button should grab the project data in JSON format -- that part is easy! - and then
        - use it to create a new resource in modx. THAT'S the part I don't understand. Is there a tutorial or some documentation somewhere, that I'm missing, that explains how to send data to the site?
        - there should also, I guess, be an authentication layer, and a moderation layer -- I guess I would figure out how to build those once the basics are in place.

        Really appreciate any help you can give!

          • 3749
          • 24,544 Posts
          Thanks for the kind words. smiley

          Creating a new resource in MODX Revolution is pretty simple. You just ask for a new object, set the fields, and save it. The code below, with no modifications, will create a new resource. In fact, you don't need the setContent() call. The only required fields are the pagetitle and alias.

          <?php
          
          $newResource = $modx->newObject('modResource');
          
          $newResource->set('pagetitle', 'New Page');
          $newResource->set('alias', 'newpage')
          // etc.
          
          $newResource->setContent('<p>Some Content</p>');
          
          $newResource->save();


          You can also set the fields and call the resource/create processor. That's a more reliable way to do it but the code is a little more complex.

          Your project sounds pretty challenging, but creating the resources won't be the hard part. wink


          ---------------------------------------------------------------------------------------------------------------
          PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
          MODX info for everyone: http://bobsguides.com/modx.html [ed. note: BobRay last edited this post 12 years, 1 month ago.]
            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
            • 38943
            • 6 Posts
            Ah, neat. I'm still a bit in the woods though, I think, so if you can help me keep thinking htis through I would really appreciate it. (and wow, are you bob? Your guides are really helping me!)

            I'll want to save the title, description, and a custom field (TV). So I'd need something like this:
            <?php

            $newResource = $modx->newObject('modResource');

            $newResource->set('pagetitle', $newtitle);
            // I actually don't know the right commands here
            $newResource->set('myTVName', $newTVvalue)

            $newResource->setContent($newContent);
            $newResource->save();

            But this code doesn't belong in the edit page, does it? I will need to pass the variables to a different php page somehow, presumably via an HTML form using POST or GET. But it's not clear to me what a good practice would be here, for creating a page to which to send this information. Am I understanding this correctly?

            Thanks!
            Matt
            ps, modx 2.2.0-pl1 I think!
            • Yes, he is the famous Bob. smiley

              Sorry for this question, because you're new around here, so I don't know much about you, nor could I find your introduction post.

              How deep is your knowledge on PHP coding?
              The next answers will depend on this. smiley
                Rico
                Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
                MODx is great, but knowing how to use it well makes it perfect!

                www.virtudraft.com

                Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

                Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

                Maintainter/contributor of Babel

                Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
                • 38943
                • 6 Posts
                sorry, I didn't make an introduction post, my apologies.
                I'm not a great coder, but I've learned a certain amount of PHP by working with wordpress; in wordpress, I've written theme files, modified plugins, and created my own fairly simple plugin projects. So, I guess my knowledge is moderate. I ended up over here I guess largely because I'm a heavy user of Everett Griffiths' Custom Content Type Manager in Wordpress, and he is always talking about how great modx is...
                  • 3749
                  • 24,544 Posts
                  TVs are tricky because they are not stored in the same table as the resources. In fact, they are in two separate tables, one for the TV itself (storing the type, default value etc.) and another table that keeps the values of the TV for each resource.

                  It's easy enough to handle TVs in code in Revolution, but before you get carried away with rolling your own, you might want to take a look at NewsPublisher, which will do most of the heavy lifting for you.

                  If you create a TV called MyTV, you could just put this tag on a page and have a front-end resource creation

                  [[!NewsPublisher? &show=`pagetitle,alias,content,MyTv`]]


                  With a few more properties specified, you can also have WYSIWYG editing for the content and/or the TV and you can easily secure the page so only logged-in users can create resources.


                  ---------------------------------------------------------------------------------------------------------------
                  PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
                  MODX info for everyone: http://bobsguides.com/modx.html
                    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
                    • 38943
                    • 6 Posts
                    thanks Bob! I've installed NewsPublisher, and am getting started -- I'm still working through some basic issues developing templates & so forth & haven't quite figured out an optimal development workflow yet, but I can already see some further questions I'm going to have. I'll check back in in a couple of days when I've made a little more progress. Again, thanks, I think NewsPublisher should do the trick for me, at least for now.
                      • 29151
                      • 12 Posts
                      Quote from: BobRay at Mar 15, 2012, 08:29 PM
                      Thanks for the kind words. smiley

                      Creating a new resource in MODX Revolution is pretty simple. You just ask for a new object, set the fields, and save it. The code below, with no modifications, will create a new resource. In fact, you don't need the setContent() call. The only required fields are the pagetitle and alias.

                      <!--?php
                      
                      $newResource = $modx--->newObject('modResource');
                      
                      $newResource->set('pagetitle', 'New Page');
                      $newResource->set('alias', 'newpage')
                      // etc.
                      
                      $newResource->setContent('<p>Some Content</p>');
                      
                      $newResource->save();



                      looks fine, but i have question - what else i need to add new resource into Articles container?