We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28042 ☆ A M B ☆
    • 24,524 Posts
    NewsEditor is part of the NewsManager package, it creates new documents much as NewsPublisher does.

    The page you put the NewsEditor snippet on will display the form for creating a new document. If you want MaxiGallery in the new document, you’ll either need to have it in the template the new document will use, or put the MaxiGallery snippet call in the content field of the new document.
      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
      • 8619
      • 229 Posts
      Doze,

      Thanks for the quick reply! This snippet is awesome, by the way, and I thank for you all of the hard work you have put into it.

      Here is what I am trying to do.

      I have a main Gallery page on my site that I want front end users to be able to create a new sub-gallery page into it.

      The main gallery page uses a Ditto call to show the previous posts and then goes into the individual gallery pages.

      What I have done is create a new document for my ’Editors’ called ’Gallery Creator’ which uses this snippet call:

      <p>
      [!NewsEditor? &amp;folder=`19` &amp;postid=`55` &amp;clearcache=`1` &amp;template=`global_main` &amp;formtpl=`gallerycomments` &amp;rtcontent=`tvGalleryContent`!]
      </p>

      This is supposed to be the portion that creates the new sub-gallery page that will be the container for the uploaded images.

      Once they fill in this info, it takes them to the ’Gallery Editor’ page that has the snippet call:

      [[MaxiGallery]] so that they can upload the pictures into the newly created sub-gallery page.

      The NewsEditor snippet is part of the NewsManager snippet.

      I am wanting to keep them from having to come into the back-end manager and create a document with all of the settings (cacheable, template, etc) and am working to try to figure out how to accomplish this from the front-end. I was hoping that using the NewsEditor portion, which works fine when creating a text post, would allow them to create the new page for the assets/galleries/xx where xx is the newly created page from NewsEditor.

      Is this possible or am I missing something? The problem is that when I use the NewsEditor, if I leave the ’content’ section blank, it won’t save it. When I put something into it, it is creating the page in the correct place, as a document under my main Gallery page, but when I attempt to use the MaxiGallery manage pictures button, that is when I get the 404 code posted earlier.

      Thanks!
        • 7923
        • 4,213 Posts
        Quote from: ejcross at Jan 09, 2007, 01:57 PM

        What I have done is create a new document for my ’Editors’ called ’Gallery Creator’ which uses this snippet call:

        <p>
        [!NewsEditor? &amp;folder=`19` &amp;postid=`55` &amp;clearcache=`1` &amp;template=`global_main` &amp;formtpl=`gallerycomments` &amp;rtcontent=`tvGalleryContent`!]
        </p>

        This is supposed to be the portion that creates the new sub-gallery page that will be the container for the uploaded images.
        Like Susan said, put the MaxiGallery snippet call in to the "global_main" template that the NewsEditor uses, so it will be already there when new pages are created with it. Or if that global_main is some shared template, do a new one for the NewsEditor snippet to use which has the MaxiGallery call. Or other way would be to write the MaxiGallery call to the content field.. or edit the NewsEditor snippet to make it append the maxigallery call to the data from _POST..

        Then make the NewsEditor automatically redirect to the newly created document (i believe there is a setting to do this) and users should then see that manage pictures button there..
        Quote from: ejcross at Jan 09, 2007, 01:57 PM

        Once they fill in this info, it takes them to the ’Gallery Editor’ page that has the snippet call:

        [[MaxiGallery]] so that they can upload the pictures into the newly created sub-gallery page.
        You don’t need this page, and you cannot have it either.. because the galleries are associated with the documents that they run in. Only way to do this would be to create a new snippet and use $modx->runSnippet() function to run MaxiGallery and set a view_gallery parameter to the call with the ID of the newly created document (would be $modx->getLastInsertId() if no documents would have been created in the meanwhile, but you would probably need to make the NewsEditor do the redirect and set the correct page id to the url query string and get it from there)


          "He can have a lollipop any time he wants to. That's what it means to be a programmer."
          • 8619
          • 229 Posts
          Ok, working on it now, but have some problems:

          Created a new template called global_gallery that has the MaxiGallery snippet call in it.

          On the Gallery Creator page, here is my call, need some help here:

          [!NewsEditor? &folder=`19` &postid=`[+id+]` &clearcache=`1` &template=`global_gallery` &formtpl=`gallerycomments`!]

          Where &postid is the redirect to the newly created post. How do I get it to recognize that it is assigning the id itself and redirecting itself to it?
            • 8619
            • 229 Posts
            Ok, figured out that part....removed the &postid portion and it automatically redirects to the new page.

            The new template works fine now too, brings up the ’Manage Pictures’ button, allows me to save them, upload, etc.

            Here is a new one. When attempting to go back to the main Gallery page, either through breadcrumbs or the nav link in the nav bar, I am getting a parse error:

            « MODx Parse Error »
            MODx encountered the following error while attempting to parse the requested resource:
            « `` is not numeric and may not be passed to makeUrl() »


            The gallery page is now kaput! It is giving me the parse error only on the gallery page. Not sure what has caused this, but I will keep posting with what I find.
              • 8619
              • 229 Posts
              Ok, I kicked out the gremlins from the site, and it is now working....I think I had doubled the MaxiGallery call between the template and a chunk.

              It seems to be working now just fine.

              One lingering question....When I am required to input ’Content’ in the NewsEditor page in order for it to show up, is there a way to NOT have it show up on the gallery page? I am thinking that there should be something somewhere in the NewsEditor snippet file that I can change and disable to accomplish this, but not sure. I would also have to copy it, rename it to something like ’NewsEditor2’ because I am using it also for the update posts in the members forum.

              Thanks!
                • 7923
                • 4,213 Posts
                Simply do not put the [*content*] TV to your global_gallery template.. same goes with all the fields.. But I guess it wouldn’t be so hard to modify the NewsEditor snippet to hide those fields. Or you could do a new snippet with Docmanager if you only need new pages to be created with certain titles or something..


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                  • 8619
                  • 229 Posts
                  Thanks for all of the help...I’m really learning alot of PHP lately!

                  One question with mySQL though....if I want to download what is in the db from online to local, using myphp through my site manager, does droptable cause problems on the online site? I don’t want to wipe out what I have created so far.

                  THanks!
                    • 7923
                    • 4,213 Posts
                    Umm, I don’t know what you are saying, but drop table does just that, it drops a table from the database, eg. removes it completely. If the table has stuff in it that your site access to, sure, it causes lost of trouble. But this goes so far off from the original topic (altough the topic isn’t very well named anyways), so I think we should just stop here..


                      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                      • 8619
                      • 229 Posts
                      Ok, thanks for renaming it too....

                      Also, when I get a chance, can I post this into the WIKI? Someone else might find it useful....

                      Best wishes!

                      Elliott