We are using the ECK module where we have created component eck_highlight (machine name). How would we be able to modify the variable array using a preprocess hook?
Eck_highlight component has this field:
- Field Reference to content types: basic, article, and event
Goal:
Call the preprocess to store 'info' array to vars (i.e. vars['info']). The info variable will be passed into the Twig template so we can use to output information.
mymodule_preprocess_eck_highlight(&$vars) {
$vars['info'] += [
'id' => 'some-id',
'height' => 'some-height',
'width' => 'some-width',
'src' => 'src1'
];
}
We have tried to do the following but cannot alter the variables.
- mymodule_preprocess_eck_highlight(&$vars)
- mytheme_preprocess_eck_highlight(&$vars)