0

Friends, hello. I ask for 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 of the form ad.admitad.com/blabla/blabla/subid1=userid. I need that after the user logs in, 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 like this: ad.admitad.com/blabla/blabla/subid1=2. That is, the value of this field must be dynamic, and change for each user. I was advised by hook_node_view, but I still did not understand how to do this. Please advise how I can solve this problem. I will be grateful).

2
  • If the field supports tokens, use the current user user id in place of that literal value.
    – Kevin
    Feb 15 '20 at 21:35
  • Hi Nikolasun, welcome to drupal.stackexchange.com. what is your drupal version?
    – Yuseferi
    Feb 16 '20 at 19:17

Your Answer

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

Browse other questions tagged or ask your own question.