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

    I played a bit with the NewsManager that enables a web user to edit/delete posts directly via the front-end. xyzvisual has started this but I found the snippet far from optimal: no templates, no chunks, no customization whatsoever, no documentation.

    With this slight modification I try to adjust that. However, as I’m new to modx, I would like some comments and eventually some design guidelines:
    - I use templates to personalize the layout
    - I use chunks to provide the labels for the various actions
    - per default the layout uses buttons, should it be better to use links?

    Thanks for any ideas/help

    Ronald

    EDIT:
    Sep 25, 2005:
    - Final release, downloaded to the repository.
    - Added documentation

    Todo:
    - Add language support?
      • 11975
      • 2,542 Posts
      hi,

      a great addition for a first post smiley

      I’d like to test it but I was unable to unzip it with OSX.
      Could the archive be corrupted huh

      :-)
        Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
        • 6726
        • 7,075 Posts
        This is great news, xyzvisual plugin and snippet are always very interresting but I have never used one since I can’t make them work. I am no coder, I’ll let the dev guys help you out on the code part, but the principle of MODx snippet usually is :
        - flexible templating : that means using chunks as templates and define placeholders
        - parameters : those allow to customize input variables
        - documentation : a few samples, a detailes review of which parameters can be used and how.

        I’ll definitely give a look at this, since I consider it to be a real candidate to the main MODx distro. Web users should be able to edit content, and currently QuickEdit only allow manager users to edit content from the front end thus alternatives are very much welcome...

        Edit : I gave the file a quick look, it seems you got this right on first strike, it’s very nicely put together, lots of configuration option, chunk templates, detailed parameter instructions : I like it ! Great contribution, now I have to test it smiley Bundled documentation is as good as it gets. Really, a nice job grin

        @Heliotrope : I succesfully unzipped it with BOM Archive Helper / Mac OS X, what did you use ? Stuffit Expander ?


          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l'outil id
          • 25663 MODX Staff
          • 12,272 Posts
          heliotrope, when that happens to me I (begrudgingly) go to stuffit expander and it typically will open them if OS X’s built-in archiving tool doesn’t.
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 11975
            • 2,542 Posts
            thx for the tips.

            Everithing is fine now.

            :-)
              Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
              • 29577
              • 11 Posts
              Hello,

              Thanks for the entusiasm. If there’s anything not going as planned, don’t hesitate to tell me (or adjust it smiley

              I have now updated NewsManager with the &clearcache parameter to do just that.

              The NewsEditor is another small modification of NewsPublisher: it accepts a $_POST[’editid’] in input and will pre-load the fields with the values from that document. When you save the document it will update the old one instead of creating a new one. ATTENTION: if you use a &formtpl be aware that you must make a second form and pass as &edittpl. This form must have an hidden input field: <input name="editid" type="hidden" value="[+editid+]" />. This field tells the NewEditor that it must actually update an old document instead of creating a new one.

              This should make editing from the front-end complete!

              Good night,

              Ronald
                • 32982
                • 674 Posts
                hi thanks for your work.
                  Jabiertxof (formerly XYZVISUAL)
                  My bussines: http://marker.es
                  https://www.youtube.com/user/jabiertxof/videos
                  • 29577
                  • 11 Posts
                  Hello,

                  Another small update. I tested the NewsManger and NewsEditor on my site an they seem to work quite correctly. I have not tested every feature, however.


                  • The NewsEditor now doesn’t have the &edittpl parameter anymore as I figured out that I could include the ’<input type="hidden" name="editid" value="[+editid+]" />’ field also in the &formtpl without confusing the logic.
                  • I included also an example template variable: this should be copied into the ’Default value’ of the template variable in order to have the original value of the news when editing.

                  I plan to make a nice .html documentation with an example just to make clear how the snippets work together.

                  Have fun,

                  Ronald
                    • 19554
                    • 59 Posts
                    Somehow I cannot make NewsEditor work.

                    Steps:
                    1. Create page with default template and following content ("Basic usage" from in-code documentation
                    [[NewsEditor? &folder=`2`]]
                    (where 2 is existing "Blog" folder from demo site)
                    2. I open this page and NewsEditor default form appears
                    3. I populate ALL fields, press "Submit" and I have roundtrip to server and back
                    4. When I look in admin, new page is not created in "Blog" folder.

                    Am I missing something obvious?
                      • 7923
                      • 4,213 Posts
                      Call the snippet uncached using [!...!] or set the page to not cacheable. Its needed for the post data tm be processed in snippets.


                        "He can have a lollipop any time he wants to. That's what it means to be a programmer."