drupal-theming

How to quickly theme a view?

I've defined a view with the CCK and View 2 modules. I would like to quickly define a template specific to this view. Any tutorial or information on this ? What are the files I need to modify ? Here are my findings: (Edited) In fact there are two ways to theme a view : the "field" way and the "node" way. In "edit View", you can choos...

How do I theme Form API buttons in Drupal?

The default output from Drupal's Form API is: <input id="edit-submit" class="form-submit" type="submit" value="Save" name="op"/> How do I theme that so I get: <button id="edit-submit" class="form-submit" type="submit"> <span>Save</span> </button> I need the inner span-tag so I can use the sliding doors CSS technique. I guess I n...

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...

Is it possible to add custom fields to a Drupal taxonomy term?

I'd like to add a date field to a drupal taxonomy term, alongside the default "title" and "description" Is there some technique/php/module that lets me do this? Is it possible to do with CCK?? I need to be able to display the new field in the same view presenting the content nodes referencing the term. At the moment, I've added a date...

Remove the red outline on form elements that fail validation in drupal

When a drupal form fails validation, it is redrawn with the elements that failed validation surrounded in a red border. Drupal does this by adding the error class to the input elements, and specifing a 2px red border on input.error elements in system.css. Without modifying this stylesheet, how can I remove the red border on a specifi...

How does one inject variables into page templates from a custom Drupal module?

We've created a custom module for organizing and publishing our newsletter content. The issue I'm running into now -- and I'm new to theming and Drupal module development, so it could just be a knowledge issue as opposed to a Drupal issue -- is how to get each newsletter themed. At this point the URL structure of our newsletter will be...

How do you separate the template of a blog block in Drupal?

Hi, In Drupal, I created a block using views. This block contains the latest blog entries. I've placed this on a specific page to display it as an archive. Now, as for the blog itself (for example when one of them is clicked), A blog template for it depends on node-blog.tpl.php. My problem is, when I style node-blog.tpl.php, the block I...

Count rows in Drupal views plugin

I've written myself a Drupal Views row plugin and I want to count the rows so I can do something with the output every Nth row. I can do this in the plugin's preprocessor function but if it gets used more than once (in panels for example) I can't reset the counter to zero. Can someone point me in the right direction here? ...

Are Drupal theme settings cached?

i want to change theme_username, a core theme function that outputs that dreadful "not verified" string on users who are not logged in (when they comment, for example). i want a checkbox in admin/build/themes/settings/MYTHEME to change that. but since that theme function gets called a lot, will it hurt the performance of any site using m...

Drupal - Search box not working - custom theme template

Hello, I am using a customised version of search-theme-form.tpl When I use the search box, I do get transferred to the search page. But the search does not actually take place. The search box on the search results page does work though. This is my search-them-form.tpl.php file (demo : <input type="text" name="search_theme_form_keys" i...

Drupal 6: Drupal Themer gives same candidate name for different type of content types

Hi friends, I'm a drupal newbie... I have different type of contents like News, Events, etc. and their content is different. News detail page has title-content text-date. but Events detail page has title-date-content text-location-speaker-etc. So I need different layout page for these different types. So, I enabled Drupal Themer to get...

Drupal 6: getting particular fields from Node Reference types...

Hi friends, I'm a drupal newbie... <?php print $node->field_date[0]['view']; ?> I can get the custom created CCK fields' value and display in tpl.php files as above... that's fine. my question is how can I get the Node reference fields' in-fields? for example, I have an event content type, and I have defined Node Reference for Locat...

Drupal 6: print all body field content to node template file.

I tried to display body content with: <?php print $node->content['body']['#value']; ?> However, it doesn't display all body content, it just display first paragraph of body content, sometimes 2 paragraph if it is short :/ I need to print all body. how can I do that? Thanks a lot! Appreciate helps! ...

How to organize Drupal templates?

I created a few custom templates while modifying a theme (Acquia Prosper), and my usual practice is to put all my templates in this fashion: theme-name/templates/page/page-front.tpl.php But it didn't quite work this time. So I'm wondering why. I looked through the templates.php for a clue, but there is nothing there. My base theme ...

Drupal, CCK -- remove draggable reorder for non-admins

Is there a clean way to remove the draggable option on multiple-value CCK fields? I assume I could style it out with CSS but that doesn't seem like the "right" way to do it. Ideally, the draggable option wouldn't be available for any users except admins. Thanks! ...

Theme CCK fieldset.

I am attempting to use the CCK theme_fieldgroup_fieldset($elements) hook to convert the fieldset to a two column layout. I thought that this shouldn't be to hard because the individual fields are in the $elements variable so all I have to do is iterate over them and print them individually. the problem is that I have no way to tell if t...

Custom theming for content type in Drupal

Hi, I can apply a custom theme to a certain content type in Drupal by copying the node.tpl.php file and placing the name of my content type right after the "node" in the file name and appending an hyphen. Ok, the new name is: node-page_two_columns_images.tpl.php. But that won't give me much flexibility if I am not able to edit the way e...

Drupal Zen subtheme creation problem: sidebars, header and footer regions disappear

I am currently trying to create a Drupal theme as a Zen subtheme, by doing the following: I created a new Zen subtheme by following instructions in "How to build your own sub-theme (6.x-2.x)" documentation The problem is that when I enable the new theme, no header, footer or sidebars are displayed. When the new theme is enabled, these ...

Drupal, Views module, Group fields in layout

I want to group some fields inside a div or similar HTML tag, for example I'm displaying node's title + node's teaser + node's image, I want to group the title and teaser into one DIV in layout for easier CSS styling. I know a silly method to do it in templates, but I want a quicker and easier method (Drag-and-drop in views edit). A sim...

Move node $links to a sidebar

How can I print a nodes $links in a sidebar? What function can I call to retrieve them from outside the node.tpl.php and print them? I am still on the node. Also, I can't use Panels. ...