We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37859
    • 34 Posts
    I'm a novice Modx revo user, trying to get the Newspublisher to work.
    My Newspublisher call is on resource with ID=40 :
    [[!NewsPublisher?
    &show=`pagetitle,VerDatum,VerPloeg,VerThuisploeg,VerUitploeg,VerUitslag,VerSoortWedstrijd,VerVerslagTekst` 
    &initrte=`1`
    &rtcontent=`1`
    &initdatepicker=`1`
    &listboxmax=`1`
    &templateid=`7`
    &parentid=`41`
    ]]

    As you can see I have a lot of template variables.
    The new resource must be created under resource with ID=41, and must use template with ID=7.
    The variables are assigned to the template with ID=7.

    When I go to the Newspublisher resource, it shows the form, and I can fill in all the fields/variables, but when I hit "Submit" it comes back to the form and nothing is created.

    When I leave out the &show line in the Newspublisher call, I get the standard form in Newspublisher and the resource is created at the right place with the right template!
    But as soon as I use &show it goes wrong. And I need the &show to use my template variables.

    Anyone can help ?

    Modx version : 2.3.3
    Newspublisher : 2.1.0

    This question has been answered by BobRay. See the first response.

    • Try &show without the TVs, then if that works add the TVs one at a time. There may be a problem with character sets or something odd about one of the TVs.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 37859
        • 34 Posts
        Quote from: sottwell at Jul 08, 2015, 02:33 PM
        Try &show without the TVs, then if that works add the TVs one at a time. There may be a problem with character sets or something odd about one of the TVs.

        I tried &show with only the pagetitle, and even then nothing is created. I just get the form back.
          • 42562
          • 1,145 Posts
          Add content to &show, what happens?
            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.
            • 37859
            • 34 Posts
            Quote from: donshakespeare at Jul 08, 2015, 04:02 PM
            Add content to &show, what happens?
            Thanks donshakespeare !
            That did it !
            content seems to be a required field, so now it works perfect !
              • 42562
              • 1,145 Posts
              You are right, pagetitle and content are there by default, you can re-declare it if you don't want content to be required; I am sure you have figured that out already.
                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.
                • 37859
                • 34 Posts
                Indeed, I figured that out already, but I have one next question/problem :

                Is it possible to set the pagetitle of the new resource, that is created by Newspublisher, to a concatination of some of the template variables?
                example : after hitting the submit button in Newspublisher I want the pagetitle to be VarPloeg VarDatum.

                Searched the forum and found this tread : http://forums.modx.com/thread/?thread=31326&page=1, but this is to difficult to understand for me as novice user of modx.

                Anyone can help ?
                  • 42562
                  • 1,145 Posts
                  Are your template variable values exposed in the browser at the time of saving/submitting? If so you can use JS(jQuery) to do manipulation of data on the fly.

                  If your TV values are not in the browser, that is another question.

                  Question:
                  Is pagetitle the only field with an input[type=text] that you specified in NewsPublisher?
                  If so, you can duplicate npTextTpl, and do some magic in the value of the input way before it hits the browser.
                    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.
                    • 37859
                    • 34 Posts
                    Thanks for the reply, but what exactly do you mean by exposed in the browser ?
                    In the Newspublisher form the template variables are filled in, and in the new created resource they are displayed.
                    In the pagetitle of the new created resource I want some of those template variables.

                    Pagetitle is not the only field with an input[type=text], there are also template variables with input[type=text]
                      • 3749
                      • 24,544 Posts
                      It's not clear to me whether you want to alter the pagetitle based on the TV values set by the user, or on the basis of the default TV values.

                      If you want to alter the pagetitle of the new resource on the basis of the TV values set by the user, you should be able to do it in a plugin attached to the OnDocFormSave event, though using JS to alter the pagetitle immediately based on them is also an option. If you want to alter the pagetitle shown when the form comes up on the basis of the default values of the TVs, JS would be your only option.
                        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