Drupal Answers Asked by pramodg on November 11, 2021
I have build the view to display node title and node body also I have applied combined fields filter which searches the keyword in title and body and returns the results.
While rendering the contents I have to render the title and body with the highlighted keywords that are been searched.
Currently I am using hook_views_pre_render to alter the same.But unable to replace the body text with my generated results.
How can I alter the body contents?
What variable are you modifying? When I modify Views results I usually use hook_views_post_execute
. I then modify the appropriate element in $view->result
. You may be able to do the same from hook_views_pre_render
(I don't use that one often especially in this type of case).
Answered by sareed on November 11, 2021
3 Asked on November 19, 2021 by kevin-ramirez-zavalza
1 Asked on November 19, 2021 by featherbelly
1 Asked on November 17, 2021 by user3428971
1 Asked on November 17, 2021 by hugh-esco
1 Asked on November 15, 2021 by bassem-mohamed
1 Asked on November 13, 2021 by parvateesam
1 Asked on November 13, 2021 by stavovei-ciprian
1 Asked on November 13, 2021 by joehoe
1 Asked on November 13, 2021 by webdrips
1 Asked on November 11, 2021 by saintslash
1 Asked on November 11, 2021 by pramodg
1 Asked on November 11, 2021 by pglatz
0 Asked on November 11, 2021 by manikandan
Get help from others!
Recent Questions
Recent Answers
© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP