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
    This is an auto-generated topic for NewsPublisher 1.0.5-beta1 by bobray.

    Brief Description:

    NewsPublisher presents a modifiable form for creating new resources and editing existing resources in the front end of a web site. The NpEditThisButton snippet is also included, which displays a button to launch NewsPublisher for the current page.
    NewsPublisher responds to the MODx security permissions for a page. Users without the appropriate permissions cannot create or edit pages they are not authorized to access.
      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
      • 15162
      • 59 Posts
      I haven’t found a better option for frontend editing, but unfortunately my server just does not support your plugin. However, when I updated from a previous version of NP to the newest one, I lost some functionality that I previously had. After the update the &parent=`` parameter stopped working, instead I have to use &parentid. Also I can’t get documents published by default when they are created. My old and still present problem was and is that the &template parameter does not work and because of this problem I think it’s my server’s fault: on my computer the plugin works perfectly, but on my server on a fresh install the &template parameter does not function.

      After the update I’m also getting an error:
      [2011-02-13 19:48:33] (ERROR @ .../core/components/newspublisher/classes/newspublisher.class.php : 712) PHP warning: in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument


      Here is my call:
      [[!NewsPublisher? &show=`pagetitle,longtitle,content,1,19,2,3` &initdatepicker=`1` &required=`pagetitle,longtitle,content,tags` &parentid=`2` &template=`3` [template 3 is the default template] &published=`1`]]

      On system settings I have set every document to be published by default.
        • 3749
        • 24,544 Posts
        The thing in the error log is a definite bug. I’ve fixed it for the next version.

        As you found, the name of the &parent parameter has changed to &parentId (to make the code clearer).

        I couldn’t duplicate the published bug (but I may have fixed it). Try adding the second line below as line 1061 in the newspublisher.class.php file
        (core/components/newspublisher/classes/newspublisher.class.php). If you don’t have line numbering, you can search for "array. Set them if not"
        The comment should be there already.

        <?php
                    /* these *might* be in the $_POST array. Set them if not */
                    $fields['published'] = isset($_POST['published'])? $_POST['published']: $this->published;
        


        Important: Make sure the user has the publish_document permission in the Context Access ACL policy. And publish permission in any Resource Group Access policy if the resource is in a resource group.

        I can’t reproduce the template issue and I can’t imagine why a different server would make a difference. I’m sure you’ve done most of this this already, but turn off the RTE for the NewsPublisher resource. Double-check the template ID and the spelling of the &template parameter name. Make sure there’s a question mark after the snippet name, the snippet is called uncached, and all parameters are surrounded by back-ticks and start with & (not &amp;).

        If that doesn’t work, try leaving out the &template parameter. The new resource should get the system default template (check the default_template system setting). Leaving out the &published parameter should also give the resource the default template (check the publish_default system setting too).

        I assume that you’re talking about creating a brand new resource. Existing resources will get the published status and template they already have unless you change them in the form.
          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
          • 21190
          • 6 Posts
          Looks like it ignore parent and even parentId. Doesn’t work for me.

          Another problem with TinyMCE. Buttons work well after patch, but my custom css (editor_css_path) ignored (in back-end works fine). Is there any solution? I want people to see those <p>&nbsp;</p> using border for <p> in my css.
            • 3749
            • 24,544 Posts
            Quote from: neonoviy at Feb 18, 2011, 05:22 AM

            Looks like it ignore parent and even parentId. Doesn’t work for me.

            Another problem with TinyMCE. Buttons work well after patch, but my custom css (editor_css_path) ignored (in back-end works fine). Is there any solution? I want people to see those <p>&nbsp;</p> using border for <p> in my css.

            I’ll have to look into the parent thing. What parent are they getting?

            You do know that the parent setting only applies to new docs, right? Existing docs keep their existing parents. It worked for me when I last tested it.

            I’m afraid I’m not much of an expert on TinyMCE. You might do a "view source" and see if the css path is displayed -- then put the css wherever it points to.
              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
              • 21190
              • 6 Posts
              Quote from: BobRay at Feb 18, 2011, 05:11 PM

              I’ll have to look into the parent thing. What parent are they getting?
              Defoult.
              In id 97 i call
              [[!NewsPublisher? &show=`pagetitle,longtitle,introtext,content` &parentId=`59`]] (also tried &parent)
              New documents are childs of 97

              Quote from: BobRay at Feb 18, 2011, 05:11 PM

              You do know that the parent setting only applies to new docs, right? Existing docs keep their existing parents. It worked for me when I last tested it.
              Yeah. Editing is fine. Talkin about new docs.

              Quote from: BobRay at Feb 18, 2011, 05:11 PM

              I’m afraid I’m not much of an expert on TinyMCE. You might do a "view source" and see if the css path is displayed -- then put the css wherever it points to.
              I believe it wasn’t displayed. Anyway, I’m using elRTE now, and init it manually.
                • 3749
                • 24,544 Posts
                Ah ... it’s parentid, not parentId (lowercase i).

                How are you liking elRTE?
                  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
                  • 21190
                  • 6 Posts
                  Quote from: BobRay at Feb 19, 2011, 09:52 PM

                  Ah ... it’s parentid, not parentId (lowercase i).
                  Uhhh… It works. Thanks.

                  Quote from: BobRay at Feb 19, 2011, 09:52 PM

                  How are you liking elRTE?
                  Pretty good. And elFinder is awesome. But there’s more plugins in TinyMCE, so maybe I will use it, don’t know yet.
                    • 3749
                    • 24,544 Posts
                    Did you get elRTE working in the MODx Manager, or only in the front end?
                      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
                      • 21190
                      • 6 Posts
                      Quote from: BobRay at Feb 20, 2011, 01:11 PM

                      Did you get elRTE working in the MODx Manager, or only in the front end?

                      front end only