We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3749
    • 24,544 Posts
    Did you try the new code (I corrected the post above)?

    I don't know why you would be getting a blank page. Does the Edit button work on pages where it says "Edit" ?

    ---------------------------------------------------------------------------------------------------------------
    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
      • 9439
      • 90 Posts
      I tried the new code but I still get a server error. Seems to be linked to the resource edit check $this->resource->checkPolicy('edit'). If I remove this it works, if I put it back in it fails. I've checked the resource policy and it has edit capability.

      With the old code, the edit button appears when it should (ie when I log in) and I can edit and save the resource.
        David Heriot
        pfsmedia
        • 9439
        • 90 Posts
        Can't get other parts to work either. Changing the properties for NpEditThisButton seems to work only for some properties. Changing the values for Right, Bottom or NoShow makes no difference but changing debug works. I thought that NoShow would be a neat way of solving my button control but changing the value (adding resource ids) makes no difference - the button always appears. Incidentally, the documentation says that the home page is automatically a NoShow but inserting the login and NpEditThisButton snippets into the home page makes the button appear and function as normal.

        Also makes no difference whether property changes are put in the snippet tag or whether they're in the property set (I made a dup property set as recommended).

        Removed and reinstalled just in case something wasn't installed properly but made no difference.

        Any ideas?
          David Heriot
          pfsmedia
          • 3749
          • 24,544 Posts
          Quote from: faolie at Feb 28, 2012, 02:55 AM
          I tried the new code but I still get a server error. Seems to be linked to the resource edit check $this->resource->checkPolicy('edit'). If I remove this it works, if I put it back in it fails. I've checked the resource policy and it has edit capability.

          With the old code, the edit button appears when it should (ie when I log in) and I can edit and save the resource.


          Oops, Sorry, I borrowed that code from the NP class file. It should be:

          $modx->resource->checkPolicy('edit')



          Thanks, BTW, for doing the testing. You've saved me some time.


          ---------------------------------------------------------------------------------------------------------------
          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 14 years, 7 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
            • 9439
            • 90 Posts
            No problem - free software gets free testers.

            That does work. If edit is not in the policy the button doesn't show.

            But it still doesn't differentiate between the resources within user groups. Users in UG 1 & UG2 have the same roles and permissions. The only difference is that each UG has a different resource, A & B. Currently, both UGs can edit both A & B. What I want is that UG1 should only be able to edit resources in its group, UG2 should only be able to edit resources in its group.

            That should be possible shouldn't it? And if it is, there should be a way to test for this in the snippet, same as there is now for testing edit capability.
              David Heriot
              pfsmedia
              • 3749
              • 24,544 Posts
              If I'm understanding you, you just need to put the resources into two Resource Groups (A and B),
              then connect each User Group with its respective Resource Group with a Resource Group Access ACL entry with a context of 'web', a policy of 'Resource' and a Minimum Role that the users qualify for. Then you'll need to give the anonymous User Group access to both Resource Groups with two similar Resource Group Access ACL entries, but with a policy of Load (or Load, List, and View) -- otherwise they won't be able to see the resources in the front end.

              Be sure to add yourself to both user groups (with a Role of Super User) and then flush permissions and sessions.


              ---------------------------------------------------------------------------------------------------------------
              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
                • 9439
                • 90 Posts
                Hi BobRay, I see that v1.3 is now on github. Can you tell me when it will be on package management? Not sure how to install directly from github.

                thanks
                  David Heriot
                  pfsmedia
                  • 3749
                  • 24,544 Posts
                  I'm hoping to get it out soon. I've been swamped with other stuff.

                  In the meantime, you can go here: https://github.com/BobRay/newspublisher/downloads and download it to your core/packages directory. Then in Package Manager, search locally for packages. That will put it in the grid and you can install it as usual.


                  ------------------------------------------------------------------------------------------
                  PLEASE, PLEASE specify the version of MODX you are using.
                  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
                    • 42562
                    • 1,145 Posts
                    3 years later ... but not late.

                    NewsPublisher is still the absolute ruler; I have built a tiny magical snippet that corroborates with it.
                    TinyMagicPublisher, a true frontend editing tool in your palm.

                    What is true frontend editing when the interface does not look like my site in the least ...?
                    Why does my content have to be cloned to forms ...?
                    Why can't I just edit the very page I am looking at ...?
                    How can I utilize the powerful qualities of NewsPublisher in my own way ...?

                    If these are your questions ... look no further

                    With this snippet call in your template - any template for that matter, and adding one CSS class name, data-tiny to each respective element or, coming soon, add a modifier, useTMPmodifier , you can edit any field in your resource, beautifully - even if the content has [[$MODX tags]]

                    Oh, and if this magic is too much and you want to use NewsPublisher in the original form set &npPureMagicNonTraditional=`0` - all your RTEs will still be magically taken care of by the chunks you have prepared in your Manager.

                    <h1 data-tiny="np-pagetitle">[[*pagetitle]]</h1> //[[*pagetitle:TinyMagicPublisherModifier]]
                    <p data-tiny="np-introtext">[[*introtext]] </p> // [[*introtext:TinyMagicPublisherModifier]]
                    
                    [[!TinyMagicPublisher?
                    &useTMPmodifier = `1`
                    &npPureMagicNonTraditional=`1`
                    &npTraditionalTinyChunk=`TinymceWrapperNPtraditional`
                    &npDebug=`0`
                    &autoFileBrowser=`elFinderBrowser`
                    &elFinderBrowserRTEurl=`elFinder.html`
                    &responsivefilemanagerBrowserRTEurl=`[[++assets_url]]components/tinymcewrapper/responsivefilemanager/filemanager/dialog.php?type=1`
                    &responsivefilemanagerBrowserRTEtitle=`Responsive FileManager`
                    &roxyFilemanBrowserRTEtitle=`Roxy Fileman`
                    &roxyFilemanBrowserRTEurl=`[[++assets_url]]components/tinymcewrapper/roxy/fileman/roxy.php`
                    &mainCSSfile=`[[++assets_url]]components/tinymcewrapper/frontend/mainCSSfile.css`
                    &jsTopBarButtonsTpl=`TinymceWrapperNPpublishButtonsTpl`
                    &npCreateResource =`1`
                    &npNoShow=`100,115`
                    &npCancelCreateId=`1`
                    &chunkSuffix=``
                    &editThisButton=`Edit`
                    &createNewButton=`New`
                    &tinymceCDN=`//cdn.tinymce.com/4/tinymce.min.js`
                    &jQueryCDN=``
                    &npNoShowChildOfParents=``
                    &cacheable=`0`
                    &show=`pagetitle,alias,introtext,richtext,articlestags,content,TinymceWrapperServiceTV1,TinymceWrapperServiceTV2,TinymceWrapperServiceTV3,TinymceWrapperServiceTV4,TinymceWrapperCategoryTV1,TinymceWrapperCategoryTV2,TinymceWrapperCategoryTV3,TinymceWrapperCategoryTV4,TinymceWrapperCategoryTV5,TinymceWrapperCategoryTV6,TinymceWrapperImageTV1,TinymceWrapperImageTV2,TinymceWrapperImageTV3,TinymceWrapperImageTV4,TinymceWrapperImageTV5,TinymceWrapperImageTV6,TinymceWrapperMiscTV1,TinymceWrapperMiscTV2,hidemenu,published,publishedby,description,menuindex,menutitle,longtitle,pub_date,publishedon,unpub_date,parent,template,deleted`
                    &twTagsTV= `articlestags`
                    &twExistingTagsChunk = `twExistingTags`
                    &commonTinyMCECodeChunk = `TinymceWrapperNPCommonCode`
                    &required=`pagetitle,content`
                    &parentid=`10`
                    &parents = `10,86`
                    &templates = `1,32`
                    &templateid=`tw_ImogenTheme`
                    &initdatepicker=`1`
                    &cssfile= ``
                    &filetpl=`twBROWSERnpFileTpl`
                    &imagetpl=`twBROWSERnpImageTpl`
                    ]]
                      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.