Question

I was looking without luck for a way to be able to make a link or button with the functionality of making a new content showing some content or comment already posted above, something like the Retweet option to be more clear.

Is there a module or combination of modules to achieve this?

Edit:

Now after an answer I know it is easily rendered with a reference field, all I need now is a way to create a link that will auto fill the reference field. That way the user clicking the link never see the field, my idea is that that field is not visible in 'Manage form display'.

Edit 2:

Prepopulate module do the desired link. If I disable the field on 'Manage form display' it stop working. So I used Popup field group

As I told in the comments, this module makes a Popup with only desired fields, but instead doing it, no Popup is opened and the form is rendered with all the fields except the ones supposed to appear on the Popup, so I use the module to get my reference field only on the Popup group and that way this field disappear on create or edit content. Because I am solving this taking advantage of a module that did not do correctly what it should do, if someone thinks that this solution is not a safe way to do it let me know other way to achieve it.

Était-ce utile?

La solution

You can use an Entity Reference field. In Drupal, most of the "content" that you see, including nodes and comments, are entities.

Entities can be linked to each other with an Entity Reference field.

Here's a tutorial video.

One challenge when working with Entity Reference is that each field can only reference one type of entity-- so you can have an Entity Reference field for nodes, or for comments, but not both at the same time; to have both, you need two fields.

Out of the box, Entity Reference can be configured to select the content by autocomplete or by a select list, which can be the output of a view you have customized, so it's quite flexible.

Licencié sous: CC-BY-SA avec attribution
Non affilié à drupal.stackexchange
scroll top