We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4757
    • 64 Posts
    I'm working on a site that gives users the ability to edit the pages they have created.

    1. I have login installed and running.
    2. I have NewsPublisher installed
    3. I my templates and TVs setup for NewsPublisher
    4. I I have logged in and created a resource with NewsPublisher and it is displaying propery

    My problems are with the editing.
    Problem 1
    I have [[!NpEditThisButton]] in my template and the edit button displays when I'm logged in as the admin user. It shows up but with an error "Could not set the np_id default property. Set it manually to the ID of the Newspublisher page." when logged in as the user that created the resource.

    I'm using the [[!CheckUsersOwnPage]] snippet @BobRay has on http://blog.arvixe.com/newspublisher-limiting-users-to-their-own-pages/ to limit page editing to the user that created the page.

    Problem 2
    When clicking the edit button as either user nothing happens.

    Here is my NewsPublisher Call

    [[!NewsPublisher?
    &show=`pagetitle,address,description,email,web,phone,photo`
    &initrte=`1`
    &parentid=`8`
    &published=`1`
    &hidemenu=`0`
    &cacheable=`1`
    &searchable=`1`
    &richtext=`0`
    &template=`BusinessProfile`
    &captions=`pagetitle:Business Name,description:Describe Your Business,photo:A Photo of Your Business`
     ]]
      • 4757
      • 64 Posts
      Ok. I figured out why the edit button wasn't working. I had specified the incorrect resource containing the newsPublisher call. Clicking the edit button now sends to the create/update resource page it should.

      I am still seeing the "Could not set the np_id default property. Set it manually to the ID of the Newspublisher page." error when logged in as the user who created the resource via news publisher, but the edit button takes me to the edit page.

      After making an edit and clicking submit the page refreshes but the changes are not reflecting on the published resource.
        • 3749
        • 24,544 Posts
        This usually means that you renamed the NewsPublsher page before adding the edit button. When the property is not set, NP tries to set it by looking for the NewsPublisher page by pagetitle. Two options:

        1. Temporarily rename the page with the NewsPublsher tag on it to NewsPublisher and visit a page with the button on it, then rename it back.

        2. Add this to the NpEditThisButton snippet tag in your template:

        &np_id=`12`


        Change 12 to the ID of the page with the NewsPublisher tag on it.
          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
          • 4757
          • 64 Posts
          Thanks @BobRay. That seems to have fixed all my current issues.
            • 3749
            • 24,544 Posts
            I'm glad you got it sorted. smiley
              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