We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9583
    • 25 Posts
    Okay, I’m playing with NewsPublisher to see if I can get it to work, and I’m already stumped. tongue

    I set up a web user, logged in, and went to a page that has:
    [!NewsPublisher?folder=19&postid=19&aliastitle=1!]

    Submitted the fields, it puts the document in the right folder, but doesn’t set the author at all -- it’s blank/anonymous. I tried setting up a group as well, with the &canpost set, but that didn’t change anything.

    I thought I followed the docs correctly for setting up users, but I feel like I’m missing something. Any hints/steps I should go through to untangle this?

    Also, the postid setting doesn’t redirect back to where I want it at all, but back to the home page as such:
    home.html?refurl=%2Findex.php%3Fq%3Dnoir.html&err=1


    ("noir.html" being the friendly url, though I also have "friendly alias path" set, so the whole path to that document should be "/content/series/noir.html")

    Thoughts, pointers, admonishments? smiley

      • 18397
      • 3,250 Posts
      Hmmmm. Which version of NewsPublisher are you using?
        • 24253
        • 125 Posts
        Hi,

        I was experimenting with this snippet yesterday too, but got some problems (parser error) but it seems there is an update for it on the forum.

        About the redirecting problems, I had those too, and submitted a bug report allready smiley

        Now I’ll try again to install the newspublisher and newslisting (the latter giving me errors :-( )

        Remon

        EDIT:
        The new ListNews snippet works for me _and_ displays the user name who posted the news item smiley
          • 18397
          • 3,250 Posts
          As to the redirect, it works fine with "Friendly Alias Path" disabled.

          It uses the MODx makurl api in this line:

          UPDATE: According to Remon’s bug report http://modxcms.com/bugs/index.php?do=details&id=109 the problem is CONFIRMED WITH THIS LINE and is awaiting a fix.

          			$modx->sendRedirect($modx->makeUrl($postid));
          


          Are you giving it a numeric id and calling the snippet uncached?

          [!NewsPublisher?folder=3&postid=1!]
          


          If you are already calling the snippet correctly, try not setting the post id. The new version included in x9 redirects you to the new document you created. If that still does not work try the snippet without "Friendly Alias Path" and let us know how it goes.
            • 9583
            • 25 Posts
            Sorry to dissappear; got busy this weekend.  I’m back now. smiley

            I’m using the "Version 1.2 Beta" w/ "Patch for ’s and redirect to new post by Mark Kaplan, October 2005"  Searching on "NewsPublisher" isn’t revealing anything newer than that...

            Quote from: Mark at Nov 05, 2005, 07:45 PM

            As to the redirect, it works fine with "Friendly Alias Path" disabled.
            .
            .
            Are you giving it a numeric id and calling the snippet uncached?

            Confirmed on 1, Yes on 2.

            It redirects where I want it when I turn off "Friendly Alias Path".  Of course, I want "Friendly Alias Path"... smiley


            If you are already calling the snippet correctly, try not setting the post id. The new version included in x9 redirects you to the new document you created. If that still does not work try the snippet without "Friendly Alias Path" and let us know how it goes.

            The workflow I’m looking to set up for my authors involves redirecting to a particular folder menu and not back to the post itself.  But yeah, that worked when I first tried it and had "Friendly Alias Path" on.  But I think that’s because it didn’t actually generate an FAP for that document; it just redirected to "/57.html" off the root, without all the path info to the folder it was actually in.

            Regarding my "no user being displayed", that seems to be caused by the fact that I was using an older "listing" snippet that I made myself a little while ago from an Eto snippet.  Apparently, looking at the DB in MySQL front, NewsPublisher is setting the "createdby" to "-1", which I guess the older API doesn’t know how to deal with.  Plopping the included "NewsListing" snippet in it’s place shows the user correctly.  Which means now I have to figure out how to graft the two together to get the kind of listing I want... smiley  The &tpl setting looks promising, if I can wrap my head around it.

            Thanks, all!

            • This is the default, if you don’t specify a &tpl in the arguments. I didn’t want the author showing on the "teaser" I have on the front page of one site, so I called it with a template chunk I made identical except for the last div! Works great! Before, I had to use a hacked version that didn’t show the author and date.

                  <div class="summaryPost">
              
                      <h3>[+title+]</h3>
              
                      <div>[+summary+]</div>
              
                      <p>    [+link+]</p>
              
                      <div style="text-align:right;">by <strong>[+author+]</strong> on [+date+]</div>
              
                  </div>
                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