This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Theming a table view - howto

Hi All,

I'm quite new to drupal(around 3 weeks now and loving every minute of it:-) ) and have successfully themed a node to how I want. I am now using a view(table type) on taxonomy and would like to overide its default theming. I have read all that I can find on the theming page http://drupal.org/node/42597

All I'm after is access to the fields on each row. So when I get

StockID : Price : image: description: type :
222 : 45 : 2.gif : old : small
443 : 22 : 5.gif : newish : large

I would like to be able to space the fields out, add in a $ sign in front of the price. Maybe apply some css to it.

I have defined an overide function in template.php and can remove the output completely by commenting out the cell[data] field.

function phptemplate_views_view_table_taxonomy_term($view, $nodes, $type) {

 	$fields = _views_get_fields();



	foreach ($nodes as $node) {

		$row = array();

		foreach ($view->field as $field) {

			$cell['data'] = views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $node,$view);

			$cell['class'] = "view-field view-field-$field[queryname]";

			$row[] = $cell;

		}

	$rows[] = $row;

	}

return theme('table', $view->table_header, $rows);

}

From here I'm not sure exactly how to overide the the theming of the fields and am guessing I need to do something with this cell[data] field. I'm pretty sure it will be something simple but it is not obvious to me.

are that any guidelines for writing new modules to enhance the existing modules?

For example, logintoboggan. It enhances the login features without changing user module. It just hooks up with the login forum perfectly. How does it do it? Are there any guidelines for that? Thanks.

Bulk container add?

Looking for way to bulk add (not edit) containers (containers from Category module). Looking through the Container module code, I found the following implementation of hook_update().

category_update($node, $type = NULL)

Seems this could be called from within a loop. However, I'm puzzled by needing to supply it a node; if I'm creating a container anew, it would seem there isn't a node yet . . . unless somehow adding a container automatically creates a node first. If so, I'm not sure where to look for how that happens. Any advice would be greatly appreciated.

Module Suggestions

I am not sure if this is the right place to post this, but here goes!

I am not a programmer, in any sense of the word, the most I can manage is HTML!! But I have a suggestion for a module that I can't seem to find (Or find anything like).

A Vacation Scheduler that allows employees to request vacation time (Start Date and End Date) that will notify the manager and s/he can then approve or deny the request (With reason). If approved, it gets added to a calendar so the manager can track who is on vacation and when.

How to use the Advanced User module

I've just installed the Advanced User Module (http://drupal.org/node/67084) but I can't find any information on how to use it? How can I list the users with common profile fields??? It should describe that in the readme file... :-((

I want to list all users with a common state profile field.

Thanks for your help,

Kai

Forms - How to add elements on-the-fly?

Hi Everyone.

Say I have a simple form with a select drop-down of, for example, classes. I'd like users to be able to select a class, click an Add button, and then redisplay the page with the class(es) they have already 'added', yet continue to show the select drop-down, so they can add additional if needed.

I'm having quite a difficult time trying to figure this out... I've searched and searched, but can't find a simple explanation. Any suggestions, especially with simple examples, would be great! Thanks!

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions