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

    First, I love your plugin. This is as simplistic and as customizable as I could ever have dreamed of for allowing my clients to edit on front-end without worrying about them damaging my templates! It allows me to have multiple calls in different templates/pages to different editors / page creators for different categories. AND The form fields that show up TO be edited can even be altered. Simply amazing, I cannot thank you enough for writing this.

    Which is why I am sad to say that I am having a problem sad Not with your plugin specifically it seems, but with the integration of TinyMCE (Most Recent, installed today) into your plugin. I have all of the settings correct for it to enable the RTE and select TinyMCE, and it shows up properly for Intro Text and Content in the NewsPublisher page where the [[!NewsPublisher]] call is. Alas, none of the buttons are working for things like Bold, Center, Underlines, not even the HTML button to open a purely HTML window.

    I’ve tested that the buttons do indeed work on the back-end resource editor when I enable TinyMCE for editing, and I see from the previous posts/discussion that another user confirmed that the buttons were working for him after the "patch". As far as I know, since I installed both of the plugins today, I have the most recent version of both.

    Would you be so kind as to search that code-filled brain of yours and perhaps shed some light on my problem? I can’t very much give user/pass accounts to my clients for them to use a RTE that doesn’t, well, do any RTE’ing. Much appreciated for any insight!
      • 3749
      • 24,544 Posts
      I can help. wink

      It’s a bug in TinyMCE.

      In the file assets/components/tinymce/tiny.js

      Find line 170. It should look like this:

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


      Replace it with these two lines:

              var pr = Ext.getCmp('modx-panel-resource');
              if (pr) pr.markDirty();
        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
        • 19597
        • 44 Posts
        Quote from: BobRay at Feb 24, 2011, 10:00 PM

        I can help. wink

        It’s a bug in TinyMCE.

        In the file assets/components/tinymce/tiny.js

        Find line 170. It should look like this:

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


        Replace it with these two lines:

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



        You.... are a god.

        Altered, Cache clear, login, instantly fixed. I hope you realize how much you just saved my ass.




        Edit: One quick question if I could..

        I have a NewsPublisher page used to create / edit Job Postings on a clients webpage. The job postings are indexed using getResources, and it just so happens that I used the "Description" section as my choice for the "Location" of the job in question. So basically in Manager the Description says "Iselin, New Jersey" and getResources calls [[+description]] for the location.

        Basically my question is, is it possible to alter the word "Description" to "Location" on ONLY this NewsPublisher page (not my entire MODx) since it’s used only for Job Postings?

        I looked at the default text template:
        [[+np.error_[[+npx.fieldName]]]]
            <label for="[[+npx.fieldName]]" [[+npx.readonly]] title="[[+npx.help]]">[[+npx.caption]]: </label>
                <input name="[[+npx.fieldName]]" class="text" id="[[+npx.fieldName]]" type="text"  value="[[+np.[[+npx.fieldName]]]]" maxlength="[[+npx.maxlength]]" />


        It looks like it determines the form names itself, so I’m not sure if it’s even possible, but if anyone would know I guess it would be the developer :p
          • 3749
          • 24,544 Posts
          Actually, the credit belongs to Bruno17, who created the fix, but I’m glad it worked for you. Hopefully, it will be in a new release of TinyMCE soon.

          While I have you in a thankful mood, though: http://bobsguides.com/support-this-site.html. wink I’m hoping to break even this year.
            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
            • 19597
            • 44 Posts
            Quote from: BobRay at Feb 24, 2011, 10:31 PM

            Actually, the credit belongs to Bruno17, who created the fix, but I’m glad it worked for you. Hopefully, it will be in a new release of TinyMCE soon.

            While I have you in a thankful mood, though: http://bobsguides.com/support-this-site.html. wink I’m hoping to break even this year.


            I’m becoming quite fond of your little guide site actually, I was reading it earlier this morning when I was first about to try NewsPublisher. I’ll be certain to share once my fat government check comes rolling in :p

            While I have your attention (If I still even do wink ), any thoughts on my second question that I edit’ed in above ^^ - Not sure if you saw it or not when you were replying. Any insight appreciated, and if it’s not possible, a flat out "no, not possible" is also appreciated :p
              • 3749
              • 24,544 Posts
              It’s an interesting question. You could try a form customization rule with a constraint set to limit it to that page, but I’m not sure if it would apply in the front end. I kind of doubt it, because I think they’re applied when the Manager form is rendered.

              You could move that info into a Template Variable called Location, but that would complicate( and slow down, somewhat) your getResources call.

              The only other way I can think of would be to hack the NewsPublisher code.

              You’d have to change line 659 of the core/componenets/newspublisher/classes/newspublisher.class.php file from this:

              $replace['[[+npx.caption]]'] = '[[%resource_' . $field . ']]';


              to this:

              if ($field == 'description') {
                  $replace['[[+npx.caption]]'] = 'Location']]';
              } else {
                  $replace['[[+npx.caption]]'] = '[[%resource_' . $field . ']]';
              }


              I think that would do it, but unfortunately, it would be overwritten whenever you updated the component.

              You could hard-code it into the Tpl chunk, but only if that was your only text field -- pretty unlikely.
                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
                • 19597
                • 44 Posts
                Quote from: BobRay at Feb 24, 2011, 10:52 PM

                It’s an interesting question. You could try a form customization rule with a constraint set to limit it to that page, but I’m not sure if it would apply in the front end. I kind of doubt it, because I think they’re applied when the Manager form is rendered.

                You could move that info into a Template Variable called Location, but that would complicate( and slow down, somewhat) your getResources call.

                The only other way I can think of would be to hack the NewsPublisher code.

                You’d have to change line 659 of the core/componenets/newspublisher/classes/newspublisher.class.php file from this:

                $replace['[[+npx.caption]]'] = '[[%resource_' . $field . ']]';


                to this:

                if ($field == 'description') {
                    $replace['[[+npx.caption]]'] = 'Location']]';
                } else {
                    $replace['[[+npx.caption]]'] = '[[%resource_' . $field . ']]';
                }


                I think that would do it, but unfortunately, it would be overwritten whenever you updated the component.

                You could hard-code it into the Tpl chunk, but only if that was your only text field -- pretty unlikely.


                Yeah I have 2 Text Fields sadly, so the Tpl Chunk hardcode wouldn’t work out... and I am not too familiar with Template Variables for this type of use, so I can’t really do that one I don’t think. Hard code is probably my only option, but I’ll keep exploring. Actually, technically I could do a really ugly CSS/HTML Hack probably, just set a <div> with a white background to match my layout, z-index it, and absolute position it to hide the word "Description" and write "Location" in the Div :p but I am trying to avoid that unless there is no other option hahaha


                I really appreciate your help though man, you are very knowledgeable. I know a lot about Web Design but I’m only a 6 month Revo Veteran so I’m still learning
                  • 19597
                  • 44 Posts
                  Quote from: Minaris at Feb 24, 2011, 09:36 PM

                  Hi,

                  First, I love your plugin. This is as simplistic and as customizable as I could ever have dreamed of for allowing my clients to edit on front-end without worrying about them damaging my templates! It allows me to have multiple calls in different templates/pages to different editors / page creators for different categories. AND The form fields that show up TO be edited can even be altered. Simply amazing, I cannot thank you enough for writing this.

                  Which is why I am sad to say that I am having a problem sad Not with your plugin specifically it seems, but with the integration of TinyMCE (Most Recent, installed today) into your plugin. I have all of the settings correct for it to enable the RTE and select TinyMCE, and it shows up properly for Intro Text and Content in the NewsPublisher page where the [[!NewsPublisher]] call is. Alas, none of the buttons are working for things like Bold, Center, Underlines, not even the HTML button to open a purely HTML window.

                  I’ve tested that the buttons do indeed work on the back-end resource editor when I enable TinyMCE for editing, and I see from the previous posts/discussion that another user confirmed that the buttons were working for him after the "patch". As far as I know, since I installed both of the plugins today, I have the most recent version of both.

                  Would you be so kind as to search that code-filled brain of yours and perhaps shed some light on my problem? I can’t very much give user/pass accounts to my clients for them to use a RTE that doesn’t, well, do any RTE’ing. Much appreciated for any insight!


                  Hey BobRay, I know that TinyMCE isn’t your package, but you’ve been so helpful to me so far I was wondering if you might have any idea why SOME of the buttons in the editor still don’t work after your fix? Things like Bold, Sub/Super Script, Italic and Underline all work fine, in-fact, as far as I can tell EVERYTHING works fine other than:

                  Text-Positioning (Center,left, right, justified)
                  The Styles drop-down box doesn’t even drop down, but the Format one does?


                  Any thoughts?
                    • 3749
                    • 24,544 Posts
                    Sorry, no idea at all. Bruno17 is the resident TinyMC expert, so he may know.

                      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
                      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?