We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 43864
    • 151 Posts
    I have a website that has several projects on it, each project has his own page (url). On that website there's a client-area. When the client logs in, he can see the projects he ownes.

    I want that the client can change the content of that project from within the client-area, so without going to the page of the project itself. (this is very important). So in the client-area he sees the content of that projectpage and must be able to change that content.

    Can this be done with Newspublisher?

    This question has been answered by sitsol. See the first response.

      • 3749
      • 24,544 Posts
      If I'm understanding you, yes, it should be possible with NewsPublisher.
        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
        • 43864
        • 151 Posts
        Quote from: BobRay at Jun 27, 2017, 08:42 PM
        If I'm understanding you, yes, it should be possible with NewsPublisher.

        Well, in meantime I found this could be done with:

        [[!NpEditThisButton? &np_id=`[[*NpId]]` &ownpagesonly=`0` &np_edit_id=`[[+id]]`]]


        But what I would like is that the client gets a list of projects and by clicking on a project the fields open (like bootstrap 3 tabs) en he can edit the resource. Now I first see an empty newspublisher (like for creating new page), then the edit button and only when clicked on the edit button the page is reloading and showing the content in the newspublisher fields. Can't this be done in another way? Or can't this be loaded in one page?
          • 3749
          • 24,544 Posts
          There is a way to have multiple "Edit" buttons on a page, and each one could point to any page. You might need a custom snippet to generate the list of projects and edit buttons, but it might be possible with getResources or pdoResources and a creative TPL (maybe with a TV specifiying the ID of the resource to edit).
            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
            • 43864
            • 151 Posts
            It works when I open a new page for it, not what I want but acceptable for the moment.

            Two issues however:

            1) When I reload that page I get a blank newspublisher, when I then fill it in a new page is created. I want to avoid this. How? I only want Newspublisher to be used to edit pages, not to create.
            2) This one is worse: I can't get the filemanager work. I have &initfilebrowser on and all my permissions are OK (save doc & save). I get the popup but with the message 'to many redirects'. Did I forgot something?
              • 42562
              • 1,145 Posts
              Have you tried TinyMagicPublisher?
              The snippet appends and enforces an edit=true, create=true parameter to your resources url and thus ensures that all your present problems do not occur.

              When you list all the pages that your user has created and can edit, simply add the edit param:
              <b>Please click to edit</b>
              <a href="article1.html?edit=true">Article One of 100</a>
              <a href="article2.html?edit=true">Article Two of 100</a>
              <a href="article3.html?edit=true">Article Three of 100</a>
              


              Note: the pages without the edit param will still have a nice edit button on the article itself
              <a href="article4.html">Article Four of 100</a>


              I might make this snippet into a standalone Extra in a few days
                TinymceWrapper: Complete back/frontend content solution.
                Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
                • 3749
                • 24,544 Posts
                Sorry, I just remembered that the NpEditThisButton now sets a $_SESSION variable to cure a security vulnerability, which means that having multiple edit buttons on a single page probably won't work, unless each one is part of a form, and you create a custom form-processing snippet that sets the $_SESSION variable.

                I think you might be better off with donshakespeare's solution.

                When you reload the NP page after reaching it from an edit button, it should just reload the information for that page and let you edit it again.
                  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
                  • 43864
                  • 151 Posts
                  Quote from: donshakespeare at Jun 28, 2017, 02:38 AM
                  Have you tried TinyMagicPublisher?
                  The snippet appends and enforces an edit=true, create=true parameter to your resources url and thus ensures that all your present problems do not occur.

                  When you list all the pages that your user has created and can edit, simply add the edit param:
                  <b>Please click to edit</b>
                  <a href="article1.html?edit=true">Article One of 100</a>
                  <a href="article2.html?edit=true">Article Two of 100</a>
                  <a href="article3.html?edit=true">Article Three of 100</a>
                  


                  Note: the pages without the edit param will still have a nice edit button on the article itself
                  <a href="article4.html">Article Four of 100</a>


                  I might make this snippet into a standalone Extra in a few days

                  OK, I will check this out, is there a good tutorial for TinyMagicPublisher somewhere? One question: will I still be able to use another editor in the backend? I always use Redactor in de backend (and Ace for coding).
                    • 42562
                    • 1,145 Posts
                    Yes, since the whole thing is unfortunately suited up at the moment, once you install TinymceWrapper, immediately deactivate the TinymceWrapper Plugin.
                      TinymceWrapper: Complete back/frontend content solution.
                      Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                      5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
                    • discuss.answer
                      • 43864
                      • 151 Posts
                      YES! I did it, everything is working fine! I didn't use TinymceWrapper, only Newspublisher.

                      Short briefing:

                      from within a client-zone on the frond-end, the client can now:

                      - get a list of all his projects (every project is a resource located somewhere else in the context-tree)
                      - update every project from within the client-zone (I don't go to the resource itself, but load it into a new dynamic page)
                      - put extra resources (updates) on the project-page (= create children on the project)
                      - delete and update the extra resources
                      - I use 4 different Newspublisher snippets to get other output
                      - updated the look of the forms and the buttons (most throught the tpls, some throught jquery like the "edit"-button.
                      - everything secured

                      Happy about this. On some points Newspublisher could use some improvement, like setting the parentid to a dynamic post-field (I had to use a "get" to make it work) and documentation. But overal a good addon.