This forum is for assistance with theme development.

changing page template based on node type from within template.php

Hi folks,

I'm trying to serve a specific page template for all nodes that are forum posts.

As of right now, I've been twiddling in template.php to do similar work (serve different templates based on url arg()).
Here's the function I'm using. Note that I've bveen trying to grab the node type (if (arg(0) == 'node' && is_numeric(arg(1))) and then trying to load a page template based on that: elseif ($node->type == 'forum') {

I thought this was the proper way to do this, yet now I'm getting some mySQL errors:

warning: Invalid argument supplied for foreach() in /netops/www/drupal-4.6/modules/node.module on line 358.

warning: implode() [function.implode]: Bad arguments. in /netops/www/drupal-4.6/modules/node.module on line 363.

user error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
query: SELECT n.*, u.uid, u.name, u.picture, u.data FROM *****.node n  INNER JOIN *****.node_access na ON na.nid = n.nid INNER JOIN newmbc.users u ON u.uid = n.uid WHERE  (na.grant_view = 1 AND CONCAT(na.realm, na.gid) IN ('all0','simple_access0')) AND   in /*****/www/drupal-4.6/includes/database.mysql.inc on line 66.

Anyone have an idea what I'm doing wrong here? Thanks in advance!

Here's my function from template.php:

<?php

PHPTemplate was instructed to override the field theme function error - CCK, Box gray, 4.7.2

Hi,
I'm setting up a site on 4.7.2 and created a new content type using CCk. I want to remove the field-labels so I copied the template.php innards in CCK theme directory and appended to the template.php file in box gray. I copied over the field.tpl.php file from the CCK theme directory into the Box gray directory as directed in the readme.txt of CCK.

This is my template.php file in Box gray with the appended info from CCk:

function phptemplate_image_gallery($galleries, $images) {
  return _phptemplate_callback('image_gallery', array('galleries' => $galleries, 'images' => $images));
}
function phptemplate_field(&$node, &$field, &$items, $teaser, $page) {
  $variables = array(
    'node' => $node,
    'field' => $field,
    'field_type' => $field['type'],
    'field_name' => $field['field_name'],
    'label' => $field['widget']['label'],
    'items' => $items,
    'teaser' => $teaser,
    'page' => $page,
  );

  return _phptemplate_callback('field', $variables, 'field-'. $field['field_name']);
}

My field.tpl.php file looks like this:

print strtr($field_type, '_', '-') field- print strtr($field_name, '_', '-') ">
foreach ($items as $item) {
print $item['view']

}

how to theme a multi-level navigation menu, like in kerneltrap.org

hi all.

I would like have a muli-level navigation menu on my
Drupal 4.7.0 site, just like this - http://kerneltrap.org/news/dragonflybsd

can help me how to do that?

enky

profile_listing Customization Almost Complete - Need Help

I have successfully created a custom Profile Listing Page ( profile_listing.tpl.php ) for a site I have been developing. I read all of the other posts on the forums and compiled, what I think is a very nice tableless block style layout for the listings. But, I have one big issue - Users with no pictures.

The default profile listing page shows the site default "no image" image, but I have not figured out how to do the same for my themed profile page. I should qualify all of this by saying that my programming skills are minimal and what I have accomplished thus far was alot of trial and error.

The page template uses an if statement for calling those user who have pictures, so I am guessing that an if else statement would allow me to insert a placeholder graphic for those that do not have pictures.

I am sure for someone this is a duh questions, but for me, well .. not something I have been able to figure out.

Can someone help

Here is the page template code:

if($user->picture):
Only local images are allowed. print $user->picture ">

endif;
profile_load_profile($user->uid)

IE stuffn me theme

As you would expect IE is stuffn my theme

My URL is www.stealthtutorials.com

The theme is based on BlueMarine, the sidebars are taken from Connections.

I am using a CivicSpace install of 4.6

any help would be greatly appreciated.

THANK YOU

Owen

taxonomy_image and pushbutton

hello, can anyone tell me (in a easy way) how to implement the taxonomy_image module in my site?

drupal 4.7.2
taxonomy image csv
and no idea to hack my pushbutton theme (or the theme-engine?)

greets

Pages

Subscribe with RSS Subscribe to RSS - Theme development