I want to show a list of links to the 5 latest news on my homepage.
I learned that I can install the Views module to make a snapshot of a content type. I also use EVA to create a EVA field from the view and attach it to my homepage content type.
Then I can intercept the value of the view in my homepage_preprocess_node but the problem is that the value is a long string containing the whole list wrapped with html.
This is bad...
I want to have full control of the html. I tried different options but couldn't find a clean, basic, barebone option.
I am expecting a value that is an array of 5 objects so I can loop throught them and generate what ever html I see fit. The object would contain the field I asked (title) and a url to get to the news page.
Of course I can remove the html tags and rebuild the array from that long string but I don't want to do that if there is a better solution. I will use that view on the "press room" page also, so I don't want to have to duplicate code in two different preprocess_node functions
Nothing is simple in Drupal...
I wanted to add "EVA" as a tag for this question but it's not available.