We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14673
    • 18 Posts
    I also wanted to make a suggestion regarding the input form used by NewsPublisher.

    I realise you wanted to make the fields easy to reference in CSS so people can style them easily, however the problem I’ve found is that you end up with some very generic input IDs - eg #content and #pagetitle. It took me quite a while to realise that that’s why those fields looked funny in my newsPublisher instance - my CSS was referring to pre-existing divs with those exact IDs.

    Maybe you could just put a np- prefix on the IDs for the input fields?
      • 3749
      • 24,544 Posts
      I’ve been intending to do that (and add handling for image TVs). I just haven’t had the time.

      If only there were more hours in the day. wink
        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
        • 14673
        • 18 Posts
        Thanks for that BobRay. In the meantime I’ve gotten away with editing the tpl for each input type and adding the prefix myseld, then updating my CSS to match.

        Did you see my earlier post regarding some other problems I’m currently having with NewsPublisher?
          • 3749
          • 24,544 Posts
          Quote from: jono1 at Mar 06, 2011, 06:52 AM

          Hi,

          I’ve just started playing with NewsPublisher today and I can honestly say I think it’ll be a godsend - if I can get it working the way I want it to.

          My problem seems to be that a couple of the snippet parameters have no effect. For instance, this is my snippet call:
          [[!NewsPublisher? &show=`pagetitle,content` &published=`1` &initdatepicker=`0` &hidemenu=`1` &template=`Blog Post` &tinyheight=`250px`]]

          I’m going for an uber-simple way for my users to add a new news item to the site. The way I’ve got things set up, the news items should always be hidden from the menu. If I leave in the GUI option for showing/hiding the resource, it seems to work OK. But I’d prefer not to leave that up to my users to remember, so I hide that option and set &hidemenu=`1` in the snippet. However, this doesn’t seem to make any difference.

          Also, the Cancel button seems to appear regardless of what I set the &cancelbutton parameter to.

          The other thing I’ve noticed is that if I have the RTE switched on for the content textarea, the content of the textarea is just ignored, and NewsPublisher comes back with an error saying I have to fill in that field.

          Any ideas?

          TBH, I don’t think I’ve tested the cancelbutton option. I’ll be doing some work on NP soon and will check that out. hidemenu has always worked when I tested it. I assume that you’re hiding it in the Manager with form customization. That may interfere with the parameter working. If so, I’m not sure there’s anything I can do about it. You might try including the hidemenu field as a hidden field in the form.

          Having the RTE on with the content field required has worked fine for me, so I’m not sure what would cause that problem. Have you changed the name of that field in the Tpl chunk by any chance? As a workaround, you could use the &required parameter and just not make that a required field. It’s pretty rare for people to forget to fill that in and they can always do so later.
            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
            • 3749
            • 24,544 Posts
            Duh. It’s a mistake in the tutorial. If you don’t want a cancel button, just remove it from the npOuterTpl chunk.
              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
              • 14673
              • 18 Posts
              hidemenu has always worked when I tested it. I assume that you’re hiding it in the Manager with form customization. That may interfere with the parameter working.
              Well I’ve tried to use form customisation on that stuff, although it’s just flat out not working for me (http://modxcms.com/forums/index.php/topic,61621.msg349979.html), so I assume that’s not the issue. However, using your suggestion of including it as a hidden input field has done the trick.

              Having the RTE on with the content field required has worked fine for me, so I’m not sure what would cause that problem. Have you changed the name of that field in the Tpl chunk by any chance? As a workaround, you could use the &required parameter and just not make that a required field.
              I haven’t changed the name, although as previously mentioned I *did* change the id from content to np-content - however changing that back made no difference. Making the field non-required has gotten around the error however I’m still finding that the content from the RTE just isn’t making it through - I end up with a new resource with a title but no content at all.
                • 14673
                • 18 Posts
                OK, I just tested creating a resource from the Manager and it appears that it’s having the same issue there - the content doesn’t make it through. I’m starting to wonder if it’s a problem with the update to TinyMCE I installed last night.

                UPDATE: OK, seems TinyMCE issue is confirmed as a bug: http://modxcms.com/forums/index.php/topic,61947.0.html
                  • 3749
                  • 24,544 Posts
                  A new PL version was just released that fixes that issue. It still needs the fix for line 170 of assets/components/tinymce/tiny.js to get the buttons working in the front end:

                  Change:

                  Ext.getCmp('modx-panel-resource').markDirty();


                  to:

                  var pr = Ext.getCmp('modx-panel-resource');
                      if (pr) pr.markDirty();


                  I’m hopeful that a version (pl2?) with that fix in it will appear very soon.

                  Bob
                    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
                    • 3798
                    • 1 Posts
                    I’ve created document called "NewsPublisher" and put the code [[!NewsPublisher]] in the Resource Content field.
                    Why all my posts gets differnent ID’s.
                    I would like that all posts will appear on my "Blog" page with id=2.
                    I’m newbie, what I missed, what I don’t know.
                      • 3749
                      • 24,544 Posts
                      Every resource in MODx must have a different ID. It’s a requirement of the database.
                        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