I just started playing with Drupal and I'd like the user to be able to add a custom node(or content) outside the admin by providing a form and then add that to Drupal's database once submitted. How do I do this programmatically and securely? Wordpress has a wp_insert_post() function for this functionality, what's the Drupal version?
1 Answer
Are you sure you want to do it programmatically? You can just create the Content Type and use Permissions to control which user's roles can add/edit/delete that type of content.
-
Well, I'd like the form to be embed-able anywhere in a page just like a widget. I don't want to provide the whole admin interface in creating the node. Could the method you suggest accomplish that?– jilseegoCommented Feb 9, 2012 at 14:42
-
Sure, for instance you can use Page and Panels modules to put the form anywhere within the page content.– dxvargasCommented Feb 9, 2012 at 14:46