We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40088
    • 708 Posts
    Revo 2.3.5
    NP 2.1.0

    When I use a basic NP call e.g.,
    [[!NewsPublisher]]

    the duplicate button renders fine.

    However, when I use a custom &outertpl property the duplicate button does not render.
    [[!NewsPublisher?
        &show=`longtitle,description,introtext,content,published,deleted`
        &parentid=`2`
        &template=`1`
        &outertpl=`NewsPub Article Edit Form`
        &listoutertpl=`NewsPub List Outer`
        &booltpl=`NewsPub Boolean`
        &texttpl=`NewsPub Text Field`
        &textareatpl=`NewsPub Text Area`
        &filetpl=`NewsPub File Upload`
        &summaryrows=`6`
        &duplicatebutton=`1`
        &confirmdelete=`1`
        &captions=`description:‘Description’,
        introtext:Article Summary,
        content:Article Content,
        published:Online Status,
        deleted:Delete Article`
    ]]

    The &outertpl Chunk
    [[!+np.error_header:ifnotempty=`<h3>[[!+np.error_header]]</h3>`]]
    [[!+np.errors_presubmit:ifnotempty=`[[!+np.errors_presubmit]]`]]
    [[!+np.errors_submit:ifnotempty=`[[!+np.errors_submit]]`]]
    [[!+np.errors:ifnotempty=`[[!+np.errors]]`]]
    
    <form action="[[~[[*id]]]]" method="post" class="newsPub articleHook">
            <input name="hidSubmit" type="hidden" id="hidSubmit" value="true">
            <fieldset>
    	        <legend>Edit Article</legend>
    		[[+npx.insert]] [[+np.post_stuff]]
    	</fieldset>
    	<input type="submit" class="button" name="Submit" value="Submit">
    	<input type="button" class="button" name="Cancel" value="Cancel" onclick="window.location = '[[+np.cancel_url]]'">
    </form>

    This setup works perfectly with the exception of the duplicate button and confirm delete properties.

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

    [ed. note: todd.b last edited this post 11 years, 3 months ago.]
      Todd
    • discuss.answer
      • 3749
      • 24,544 Posts
      I don't see this in your outerTpl chunk:

      [[+np_duplicate_button]]
        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
        • 40088
        • 708 Posts
        Thanks.

        I thought the button code would automatically get squirted into the NP form just like it does when I use the default (basic) NP call. I guess I was wrong.

        Can you think of a reason why "confirm delete" doesn't work? Do I need to add something extra for that, too?
          Todd
          • 3749
          • 24,544 Posts
          Same issue, you need this:

          [[+np_delete_button]]


          Moral: When you create your own Tpl chunks, make sure they have the same NP tags as the originals. 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
            • 40088
            • 708 Posts
            Ah.
            I was already using the resource field "deleted"
            &show=`... deleted`

            so I assumed &confirmdelete would work in tandem with that field.

            Thanks.
              Todd
              • 3749
              • 24,544 Posts
              Those properties just determine whether NP will replace the tags with the appropriate code or not.
                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