preprocess

Include CSS or Javascript file for specific node in Drupal 6

What is the best method for including a CSS or Javascript file for a specific node in Drupal 6. I want to create a page on my site that has a little javascript application running, so the CSS and javascript is specific to that page and would not want to be included in other page loads at all. ...

Drupal *_preprocess with a module

I'm new to Drupal dev, and was trying to add an existing region variable to my module's preprocessor function. Basically, I've created a new region for my site (here's the definition from within side my theme's .info file): regions[feeds] = Feeds From Administer->Blocks, I've added the blocks I want to the new "Feeds" region. Then, ...

Changing CCK Title for Form

By default a CCK form creation has a title of the form Create [Your Content Type Name Here] I want to change mine to Register for Such and Such It was suggested that I could use string-override, but I can't find the string to replace. I've also tried writing code to form_alter, but can't seem to figure out how to get the "title" ...

Drupal: Adding content to a View

I've created a Block using a View and would like to add some information to it that cannot be obtained from the View itself. I need to write a small function that queries for some extra data. I thought of putting this function in the MYTHEME_preprocess_node but when I put a simple $variables['test'] = 'test' and then do a print $test in...

Drupal6: Embedding a region in a view .tpl.php file

Anyone have any ideas on how I might embed a region into a view .tpl.php file? I accomplish it easily enough in a node .tpl.php by adding something like this to theme_preproces_node(): $vars['promos'] = theme('blocks', 'promos'); No problem at all. However, there obviously isn't a theme_preprocess_view() function, and I get memory e...

How can I theme the template for edit or add a node for a specific content type?

I want to theme the template for edit or add a node for a specific content type. For example, to theme all the content type forms I use the file page-node-{add|edit}.tpl.php (depending what I need to do add or edit). But I didn't found the template name for a custom node type, for example Products. I need to theme only for Products, bu...

Customize the theme output for the search box in Drupal

I am trying to change the HTML that is output when I print $search_box in my page.tpl.php file. I understand the process of overriding something in drupal but I have no idea how to do it for the search box. This is the only bit of information that I have found that seems related but I don't known how to apply it to solving my problem: h...

Drupal: Views titles

I have a View that outputs a page. Under Basic Settings I set a "title". When I load the page, I see that title as the page title (at top of the browser) - all good. How can I print this value out in the "Display output" .tpl file? The $title variable doesn't seem to hold any value here. Do I need to use a preprocess function? Thanks ...

Drupal: passing variable from preprocess to template.php?

How can I get a value from a preprocess function to template.php, in a function named sitename_modulename_user_loginblock($form)? I created the value in the preprocess function with a custom query so I could do that in the loginblock function itself, but only $form is available there and I need 3 other variables to construct the query. ...

Change the order of the 'Search this site' form in Drupal

I need to change the layout of the Search Block in Drupal. It’s currently ordered Search Button > ‘Search this site’ > Search Input but the designs I have want it to be Search Input > ‘Search this site’ > Search Button How do I go around changing the order in Drupal? I can change the search-block-form.tpl.php so the submit button i...

drupal's hook_preprocess_page not working as expected

i am having an issue where hook_preprocess_page 's changes to &$variables is not being rendered, even though it is the last item under $theme_registry['page']['preprocess functions']. logging contents of $variables to a file show the contents changed, but contents appear unchanged on the site. flushed all cache on drupal, flushed all bro...

preprocess function for cck node types

(Note: I originally posted this on drupal.org before remembering that I never get a response over there. So, sorry for the cross-posting) Hello, is there a way (built-in or otherwise) to add preprocessing functions for particular cck node types? I am looking to do some preprocessing of a field within my cck node type. Currently I can ei...

Drupal 6 preprocess blocks & nodes

I build a BLOCK that sits on a right side of the website and is available for whole site. Also I got a many CONTENT_TYPE NODES like (pages, news,gallery, files). How can I modify _preprocess_xxxxx and which one, so I can let my BLOCK know which CONTENT_TYPE is currently displaying. so then my BLOCK displays var $section = top 10 dow...

Drupal: Create a unique selector for admin styles?

I'd like to style some components differently in the admin. How could I generate a unique id/class on the body element so I could style admin elements separately? ...

Accessing user profile variables

Using the profile module I've created a textfield called profile_real_name which the user fills out when registering. How do I access this variable in the node.tpl.php? I used the dsm($user) function to output the user variables and it contained everything except the data for the profile_real_name I also ran dsm($vars) on the phptempl...

drupal: add search field to an article

hi, how can I add the search field (searching for all content and tags in my webiste) to my article ? I've already installed and activated the module, but I would like to add it to a single article instead of a block of my website thanks ...

Prevent drupal from loading other module's javascript

I have a drupal page that I'm using in a way that's very different from all the other pages of the site. I have a module that loads a set of specialized js on this page. I'm finding that my JS does not work well with the js from other modules or perhaps drupal core. How can I prevent the other modules from doing drupal_add_js on that s...

How do I use theme preprocessor functions for my own templates?

I have several .tpl.php files for nodes, CCK fields, and Views theming. These template files have a lot of logic in them to move things around, strip links, create new links, etc. I understand that this is bad development and not "The Drupal Way". If I understand correctly, "The Drupal Way" is to use preprocessor functions in your templ...

Drupal 5 Search not working on 404 pages.

I have a <?php print $search_box; ?> in my page.tpl.php page. On pages that exist, the search works, but on 404 pages, it does not. I saw some bugs/patches threads over at drupal.org for D6.15, but none of them seem to work according to the thread and they weren't really relevant to D5.x I have a theory that the because the <?php print...

Drupal theme preprocess function - primary links

I recently wrote a theme function to add a class to my primary links that works great. I then wrote some css classes to style these links with custom background images. Worked out great. Now comes the problem, the link text for the primary links still is displayed. Normally this isn't a problem as I would just wrap the in a with a ...