preprocess

Drupal adding JS

I know this is not a Drupal forum but this forum is quick at responding so I thought I should give it a shot. Here's my problem. I'm trying to insert reference to the javascript file in the header by using drupal_add_js function. I placed this line inside template preprocess function of template.php. The result....is not working at all. ...

What does 'engine' refer to in Drupal Theming?

I've been reading about Drupal theming and preprocess functions and noticed they listed engineName_engine_preprocess & engineName_engine_preprocess_hook in the order of preprocess functions but I'm not entirely sure what the engine layer is? I understand about the core, includes, modules and themes. Many thanks ...

Drupal theme preprocess function - primary links and suckerfish menus

I have a preprocess function that works fine when the menu is single level list. However I would like it to work w/ suckerfish menus. I want to add a class to the top level menu item so that I can style it. This is the code I used for the single level menu: function cti_flex_preprocess_page(&$vars, $hook) { // Make a shortcut for th...

Drupal: cannot replace js file

hi, I want to remove a js file from my drupal website and add a custom one. This is the code I'm using in my template.php file, but it doesn't work (the old js file is still loaded). (I've cleared the cache) function zen_preprocess_page(&$vars, $hook) { /*update js file*/ $scripts = drupal_add_js(); unset($scripts['module']['sites/all...

Drupal main theme template file for any node

How can I switch to a different theme template file for any node that I want? I understand how to create sub-themes like node-recipes.tpl.php for a node that has a path of "recipes". But what I want to have control of the entire base template like page.tpl.php. Can I use some preprocess function in template.php for this? Right now I hav...

Drupal: change view argument

Hello, I searched far and wide to find a working solution to this but couldn't find it. What I want to do is change the argument that is passed to the view because I want for pathauto cleaned taxonomy terms to work as an argument. I have a code that transforms cleaned term back to a original one, but cannot make the view use it. I saw s...

Drupal preprocess function and session

Hi, I set a session var at template preprocess function in a theme I use, but the first time I open the site I cant read the session var, if I refresh the page it works fine, anybody know what can be the problem?? This is the code I use in the preprocess function: function m_preprocess(&$vars, $hook) { $default_location = array( ...