Extract Url & Title from link field in Drupal 8?

后端 未结 11 651
一生所求
一生所求 2021-01-31 05:29

I\'m trying to retrieve the URL and the Title values of a Link field in Drupal 8.

In my custom controller, I retrieve the nodes with:<

11条回答
  •  清歌不尽
    2021-01-31 05:32

    After rendering a block if you want to access the link field used in it then you can use like this $render['field_target_url']['#items']->uri inside node preprocess hook.

提交回复
热议问题