0

Im on d7, I want my body field (or any textfield attached to a content type really) to automatically become the first comment on its node. Any suggestions?

2
  • Can you explain what your use case is for this, just curious. Feb 10, 2012 at 0:03
  • Basically I want to encourage users to comment on content. People are more inclined to do so when there are comments present, making the content "talked about".
    – oobie11
    Feb 10, 2012 at 19:40

1 Answer 1

2

Without coding, I'd go for the module Rules : You can create action that are triggered after certain events, under certain conditions. In your case you can try to create a rule like this one :

  • Event : When a Node is Created
  • Conditions : You probably want to filter the node type maybe ?
  • Action : Create an entity
    • Select Comment as your entity type
    • Node referencing the comment : Use the available token "node" (the newly created node that triggered your rule)
    • Comment body : Use the available token node:body

And you're done .. 0 code, 1 module, 2 mins to setup your rule :-)

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.