We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17717
    • 433 Posts
    Hi all,

    I am using the latest version of MODx, I was wondering if is possible for a site manager to add blog entries on the frontend using the method outlined here: http://wiki.modxcms.com/index.php/Tagged_blogging_with_Ditto

    I see problems with assigning the tags using the newspublisher snippet, I might be wrong though.

    Thanks
    Lee
      http://www.blend.uk.com | Web Design by Blend
      • 18397
      • 3,250 Posts
        • 23703
        • 180 Posts
        I’ve been messing around with this and first when I read your post and the linked tutorial in the wiki I realised I might have made things more complicated than I had to. Oh, well...

        The script by alconpez that Mark links to doesn’t work. I first made a solution of my own that did work for my specific purpose. Your post brought me back to the original script. I have made the corrections needed for it to work properly.

        Use it like this:

        • In your NewsEditor chunk add [+tags+] where you want the tag checkboxes to appear.
        • In the NewsEditor snippet call add the tv you want to use with &tvtags=`tvcategories`. Add "tv" in front of the TV name.

        A small addition to NewsManager is also needed for it to work properly. The code at line 351 should be changed to the following. This ensures that when deleting a post, the corresponding TV value is deleted along with it since it is no longer needed.

          if ($deleteid == $resource[$x]['id']) {
            $tbltv = $modx->getFullTableName("site_tmplvar_contentvalues");
            $modx->db->delete($tbltv, "contentid = $deleteid");
            $modx->db->delete($tbl, "id = $deleteid");
            nm_clear_cache();
            $modx->sendRedirect($modx->makeUrl($postid));
          }