Learn, Share, Build

137
September 27, 2017, at 3:31 PM

I kind of know the basics about Drupal theming when it comes to templates. However, I have no idea on how to change forms that are used on the site.

I am using Commerce Kickstart with a the Omega Kickstart theme. There are a couple of forms like the search box or the add-to-cart form.

I did some research and came up to something like this for my themes template.php:

<?php  
function mytheme_form_alter(&$form, &$form_state, $form_id){
  if($form_id == "form_id") {
  $form['form_id']['#title'] = t('Something');
  }
}

I tried this to change the placeholder that is shown in the searchbar:

<?php  
function mytheme_form_alter(&$form, &$form_state, $form_id){
  if($form_id == "edit_search_api_views_fulltext") {
  $form['edit_search_api_views_fulltext']['#attributes']['placeholder']= t('Something');
  }
}

I used edit_search_api_views_fulltext because when I inspect the website code, it shows me the id=edit-search-api-views-fulltext. However, when I use a module that is supposed to print out the ids of forms on the Drupal page, it shows me something like id=views-exposed-form wich didnt work and doesnt seem to be right either.

So my question is how can I access that form and change what I want? And where is the HTML of that form even located? I wasnt able to find it at all.

READ ALSO
Learn, Share, Build

Learn, Share, Build

I have my PHP website developed in zend framework, I want to deploy only the changes to the production server(there should not be any down time)How can I achieve this with any of the CD (Continuous Deployment) tool

91
Learn, Share, Build

Learn, Share, Build

I have a problem, when you click the tab does not match the contents of the category

105
Learn, Share, Build

Learn, Share, Build

I am using a text editor tinymceIs their any way to make the content inside the text editor as accordion just like this?

125
Learn, Share, Build

Learn, Share, Build

The original html code is an option list:

178