'fieldset', '#title' => t('Add Scripts and Styles in Header'), '#description' => t('All the defined scripts and styles in this section would be added under the head tag.'), ); $form['hfs_header']['styles'] = array( '#type' => 'textarea', '#title' => t('Header Styles'), '#default_value' => isset($header_section['styles']) ? $header_section['styles'] : '', '#description' => t('

You can add multiple stylesheets here with multiple ways, For example:

1. <link type="text/css" rel="stylesheet" href="http://www.example.com/style.css" media="all" />

2. <link type="text/css" rel="stylesheet" href="/style.css" media="all" />

3. <style>#header { color: grey; }</style>

'), '#rows' => 10, ); $form['hfs_header']['scripts'] = array( '#type' => 'textarea', '#title' => t('Header Scripts'), '#default_value' => isset($header_section['scripts']) ? $header_section['scripts'] : '', '#description' => t('

You can add multiple scripts here with multiple ways, For example:

1. <script type="text/javascript" src="http://www.example.com/script.js"></script>

2. <script type="text/javascript" src="/script.js"></script>

3. <script type="text/javascript"><!--//--><![CDATA[//><!--// close script tag //--><!]]></script>

'), '#rows' => 10, ); $form['submit'] = array( '#type' => 'submit', '#value' => 'Save Header Settings', ); return $form; } /** * Submit handler(). */ function hfs_header_settings_form_submit($form, &$form_state) { $header['styles'] = $form_state['values']['styles']; $header['scripts'] = $form_state['values']['scripts']; serialize($header); variable_set('hfs_header_scripts', $header); } /** * Administrative settings. * * @return array * Add styles and scripts at the start of the body tag. */ function hfs_body_settings_form($form, &$form_state) { $body_section = variable_get('hfs_body_scripts'); $form['hfs_body'] = array( '#type' => 'fieldset', '#title' => t('Add Scripts and Styles in body'), '#description' => t('All the defined scripts and styles in this section would be added next to body tag.'), ); $form['hfs_body']['styles'] = array( '#type' => 'textarea', '#title' => t('Body Styles'), '#default_value' => isset($body_section['styles']) ? $body_section['styles'] : '', '#description' => t('

You can add multiple stylesheets here with multiple ways, For example:

1. <link type="text/css" rel="stylesheet" href="http://www.example.com/style.css" media="all" />

2. <link type="text/css" rel="stylesheet" href="/style.css" media="all" />

3. <style>#header { color: grey; }</style>

'), '#rows' => 10, ); $form['hfs_body']['scripts'] = array( '#type' => 'textarea', '#title' => t('Body Scripts'), '#default_value' => isset($body_section['scripts']) ? $body_section['scripts'] : '', '#description' => t('

On mostly sites, this section is used to add the Google Tag Manager. Like:

1. <!-- Google Tag Manager --><noscript>Write Your code here</script><!-- End Google Tag Manager -->

You can also add multiple scripts here with multiple ways, For example:

1. <script type="text/javascript" src="http://www.example.com/script.js"></script>

2. <script type="text/javascript" src="/script.js"></script>

3. <script type="text/javascript"><!--//--><![CDATA[//><!--// close script tag //--><!]]></script>

'), '#rows' => 10, ); $form['submit'] = array( '#type' => 'submit', '#value' => 'Save Body Settings', ); return $form; } /** * Submit handler(). */ function hfs_body_settings_form_submit($form, &$form_state) { $body['styles'] = $form_state['values']['styles']; $body['scripts'] = $form_state['values']['scripts']; serialize($body); variable_set('hfs_body_scripts', $body); } /** * Administrative settings. * * @return array * Add styles and scripts in footer (before closing the body tag). */ function hfs_footer_settings_form($form, &$form_state) { $footer_section = variable_get('hfs_footer_scripts'); $form['hfs_footer'] = array( '#type' => 'fieldset', '#title' => t('Add Scripts and Styles in Footer'), '#description' => t('All the defined scripts and styles in this section would be added just before closing the body tag.'), ); $form['hfs_footer']['styles'] = array( '#type' => 'textarea', '#title' => t('Footer Styles'), '#default_value' => isset($footer_section['styles']) ? $footer_section['styles'] : '', '#description' => t('

You can add multiple stylesheets here with multiple ways, For example:

1. <link type="text/css" rel="stylesheet" href="http://www.example.com/style.css" media="all" />

2. <link type="text/css" rel="stylesheet" href="/style.css" media="all" />

3. <style>#header { color: grey; }</style>

'), '#rows' => 10, ); $form['hfs_footer']['scripts'] = array( '#type' => 'textarea', '#title' => t('Footer Scripts'), '#default_value' => isset($footer_section['scripts']) ? $footer_section['scripts'] : '', '#description' => t('

You can add multiple scripts here with multiple ways, For example:

1. <script type="text/javascript" src="http://www.example.com/script.js"></script>

2. <script type="text/javascript" src="/script.js"></script>

3. <script type="text/javascript"><!--//--><![CDATA[//><!--// close script tag //--><!]]></script>

'), '#rows' => 10, ); $form['submit'] = array( '#type' => 'submit', '#value' => 'Save Footer Settings', ); return $form; } /** * Submit handler(). */ function hfs_footer_settings_form_submit($form, &$form_state) { $footer['styles'] = $form_state['values']['styles']; $footer['scripts'] = $form_state['values']['scripts']; serialize($footer); variable_set('hfs_footer_scripts', $footer); }