I'm trying to get some placeholder text working for the Search API form, but have a different placeholder on the front page. Here's what I have so far which does work everywhere...
function THEME_form_views_exposed_form_alter(&$form, &$form_state, $form_id) {
if (isset($form['search_api_views_fulltext'])) {
$form['search_api_views_fulltext']['#attributes']['placeholder'] = t('Search Text here...');
}
}
How can I get this working on only the front page, with a different placeholder text on all other pages? I've tried many things and totally stumped at the moment. Any help would be appreciated.