We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14420
    • 13 Posts
    newspublisher to multiple pages? i have searched the forum and there does not seem to be a solution to this other than creating an "add an article" page for each page, which isn’t ideal.

    or anyway of doing it with anything else.?
      • 14420
      • 13 Posts
      for anyone else who has this problem i have done the following, in your template for the newspublisher add a dropdown box with a list of categorys (folders) you want to post to like so:
        <label>Choose Category 
        <select name="select">
          <option value="58">News</option>
          <option value="59">Personal</option>
          <option value="60">Blog</option>
        </select>
        </label>
      


      changing the ID’s and category names to whatever the id’s and categorys are on yours, then modify the newspublisher snippet by commenting out this line:

      $folder = isset($folder) ? intval($folder):$modx->documentIdentifier;


      by adding // like so:

      //$folder = isset($folder) ? intval($folder):$modx->documentIdentifier;


      then near the bottom.

      after these lines:
                  $pub_date = $_POST['pub_date'];
                  $unpub_date = $_POST['unpub_date'];
                  $published = 1;
      

      add this line
                  $folder = $_POST['categoryid'];
      

      i have no idea of an security implications, as admins will usually be doing this i don’t think there as any risk.