0

I created a view from the user interface. This view shows some content of a type of node. For each node displayed, I want add a field "mylink custom" in this view for show a generated link.

I generate the link from a custom module, I want change the link according to the node displayed by the (row) view and some current user parameters.

How can I do that ?

I add a "Global : Custom text" default field in the user interface, but this field is global ! When I want get his value from a prerender hook view, I get only the global value for all nodes displayed in my view. But I want set a different value of my "custom link field" for each row of my view.

I didn't add a new field in my node structure because I want just display a generated text when the user go to the view page. I don't want save this value in each node because this text change each time an user go to the view page.

Thanks for help =)

0

I find how do with this usefull guide

I created a custom field and I added it to my view. The content of my field is defined in the render method of the FieldPluginBase Class.

In addition, we can quicly and properly generate a FieldPluginBase Class and views.inc with drupal console (command 'drupal gpcf')

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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