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

    Can anyone point me in the right direction on how to create a site where a visitor to the site can upload a file through the front end, do a bunch of stuff with it and then once they've got through some steps of editing it they can then share that photo on social media?

    I'm familiar with how to do 99% of it but where I'm getting stuck is that last point where the system (preferably MODX) would create a new resource supposedly with that visitors photo so that they can share the link on social media?

    Any example of the sites functionality is this:

    https://www.uelselfiefootballsticker.com

    and

    https://www.worldbloodcancerday.org/en/get-involved/upload-picture/#upload

    Thanks!
      ■ email: [email protected] | ■ website: https://alienbuild.uk

      The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
      • 37242 ☆ A M B ☆
      • 339 Posts
      Hi,

      excuse my short answer. Please look for "formit2resource". It will create resources out of form fields in the frontend. Maybe that will get you further.

      Best regards

      Guido
        • 3749
        • 24,544 Posts
        It might be possible to do that with a combination of NewsPublisher and the FileUpload snippet, though I think gallenkamp's idea is probably better.

        Creating a Resource in code is actually pretty straightforward (assuming that you're using your own custom code) Here's an example:

        $fields = array(
           'pagetitle' => 'Some Page Title',
           'alias' =  =>  'some-alias',
           'content' => '
               <h3>[[*longtitle]]</h3>
               <p>Your Photo</p>
               <img src="path/to/image" alt="your image" />', 
           'published' => '1',
           'hidemenu' => '0',
           // etc. -- other resource fields if needed
        );
        
        $modx->runProcessor('resource/create', $fields);
        [ed. note: BobRay last edited this post 10 years, 5 months 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