We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36491
    • 36 Posts
    In Newspublisher 3, has anything changed with the `&hoverhelp`-option? I don't get any TV descriptions, `[[+npx.help]]` is always empty since I updated to version 3.
      • 3749
      • 24,544 Posts
      I'm not aware of any changes to that, but I'll try to find time to take a look.

      Do you have this in your NewsPublisher tag?

      &hoverhelp=`1`
      
        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
        • 36491
        • 36 Posts
        Quote from: BobRay at Nov 22, 2017, 08:41 PM
        I'm not aware of any changes to that, but I'll try to find time to take a look.

        Do you have this in your NewsPublisher tag?

        &hoverhelp=`1`
        

        Yes, as before when I used Version 2.

        Apart from that, everything seems to work as before (or better). The name of the placeholder has not changed, has it?
          • 3749
          • 24,544 Posts
          The placeholder should be +npx.help. It gets replaced with this language tag (in the NewsPublisher class file around line 1156):

          [[%resource_' . $field . '_help:notags]]


          It could be a problem with the :notags filter itself, or a more general problem with a filter used on a language tag.

          Is there anything relevant in the MODX Error log?
            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
            • 36491
            • 36 Posts
            Quote from: BobRay at Nov 27, 2017, 07:39 AM

            It could be a problem with the :notags filter itself, or a more general problem with a filter used on a language tag.

            Is there anything relevant in the MODX Error log?

            No, I created a minimal example with minimal template and I still got no help tags (descriptions) for TVs. They only work for regular MODX-fields like [[*pagetitle]] and the like. The page created no errors.

            I checked ":notags". It works in principle.
              • 3749
              • 24,544 Posts
              This line should be around line 1453 of the newspublisher.class.php file (under core/components/newspublisher/model/newspublisher/).

              $replace['[[+npx.help]]'] = $this->modx->getOption('hoverhelp', $description, '', true);


              I believe it should be:

              $replace['[[+npx.help]]'] = $this->modx->getOption('hoverhelp')? $description : '';


              It should use the description of the TV as the hover help.
                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
                • 36491
                • 36 Posts
                Quote from: BobRay at Nov 27, 2017, 10:41 PM
                This line should be around line 1453 of the newspublisher.class.php file (under core/components/newspublisher/model/newspublisher/).

                $replace['[[+npx.help]]'] = $this->modx->getOption('hoverhelp', $description, '', true);


                I believe it should be:

                $replace['[[+npx.help]]'] = $this->modx->getOption('hoverhelp')? $description : '';

                This was the right place to look, but the suggested solution did not work. But I think this could be correct:

                $replace['[[+npx.help]]'] = $this->modx->getOption('hoverhelp', $this->props, false)? $description : '';


                (It works for me)

                Thanks for the help!
                  • 3749
                  • 24,544 Posts
                  Good catch. I think this would be slightly better:

                  $replace['[[+npx.help]]'] = $this->modx->getOption('hoverhelp', $this->props, false, true)? $description : '';
                  
                    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
                    • 36491
                    • 36 Posts
                    Great! And thanks for your help!

                    Will this be included in the next release of NewsPublisher?
                      • 3749
                      • 24,544 Posts
                      Absolutely, though it may be a while.

                      Thanks for discovering the problem and testing the solution.

                        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