1

In drupal8 is there a way to call a function only once in the theme layer. Can I call this function only once and not on other preprocessor hooks or am I using the wrong hook?

function template_preprocess(&$vars){
    //-- can I call this function only once and not on other preprocessor hooks
    _updateFieldOnNode('field_metatag_title');
}  
0

If you want to call the preprocess hook on nodes only you can use template_preprocess_node().

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.