N
N
Nikolai2020-02-15 23:22:07
Drupal
Nikolai, 2020-02-15 23:22:07

How to dynamically change the field value, depending on the authorized user?

Friends, hello. Please help, I can't figure it out. I have the following task: There is a node type "product", it has a field "field_product_url". A link is imported into this field using the Feeds module. The link is usually ad.admitad.com/blabla/blabla/subid1=userid. I need that after the user logs in, the userid changes to the id of the user who logged into the site. For example, for a user with uid 2, the link should be: ad.admitad.com/blabla/blabla/subid1=2. That is, the value of this field must be dynamic, and change for each user. Hook_node_view was suggested to me, but I still don't understand how to do it. Please advise how I can solve this problem. I will be grateful).

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question