Tag: template


Get the site base url in template.php

You can use the base_path() function. for ex. function mytheme_preprocess(&$vars) { $vars[’second_logo’] = base_path() . ‘sites/all/themes/mytheme/images/second_logo.png’; }function mytheme_preprocess(&$vars) { $vars[‘second_logo’] = base_path() . ‘sites/all/themes/mytheme/images/second_logo.png’; } base_path code: function base_path() { return $GLOBALS[’base_path’]; }function base_path() { return $GLOBALS[‘base_path’]; }


Add javascript files in the template.php – Drupal 7

In template.php function theme-name_preprocess_html(&$variables) { $options = array( ‘group’ => JS_THEME, ); drupal_add_js(drupal_get_path(’theme’, ‘theme-name’). ‘/script.js’, $options); }function theme-name_preprocess_html(&$variables) { $options = array( ‘group’ => JS_THEME, ); drupal_add_js(drupal_get_path(‘theme’, ‘theme-name’). ‘/script.js’, $options); }

C#, Microsoft Windows

Create pdf report from word template in C#

1. Create a word template from an existent word document or a new one. 2. Add fields in the word template, prefer type keyword. 3. When you have created your templates you can use the class below! Don’t forget to add a reference to the Microsoft Word Object Library from the COM tab. /* * …