This forum is for assistance with theme development.

Theme Search Results Page

I've developed a custom home page (page.tpl.php) with the standard search box on it. However, after doing the search, the home page is displayed again, but the URL indicates, for instance, "http://localhost/search/node/baby" (when searching for "baby"). How do I redirect it to a search results page, or how do I modify the current behavior?

Theming taxonomy module output

Hello!

I have drupal-based site, where my users can choose some products to buy (a little local Linux-cd shop). I've created menus which lead to static pages (Linux page and BSD page) where the apropriate goods are listed. Shopping is powered by e-commerce.

But now I have decided to make some automatization. I want something like that:

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)

Pages

Subscribe with RSS Subscribe to RSS - Theme development