This forum is for assistance with theme development.

getting list of primary links as array

Hi,

In my home-brewn theme using PHPTemplate, I'd like to replace the default
"LinkA | Link B | ... | " output (from theme('links',...)) with a selector (pulldown menu). There may be some neat javascript tricks to do this, but my knowledge just extends to a
...

type pulldown.

For this to work, I'm looking for the correct entry point in the drupal 4.7 API to get a list of my primary links (Descriptions + hrefs). Is there such functionality?

Thanks!

--nico

Garland - why you're using "max-width" for #wrapper #container?

I'm rebuilding my own theme and having a look into Garland.

Well, I didn't found the reason, why you're using the max-width in style.css

#wrapper #container {
  margin: 0 auto;
  padding: 0 20px;
  max-width: 1270px;
}

passing parameters to the menu_tree function

Hello

Is there a way of passing more parameters to the theme_menu_tree function apart from the $pid.

Basically I want to add an id to each ul element in the format of

id="menu-".

I have managed to create and id in the format

id="menu-".$pid

I can live with menu-$pid but is would like to know.

I know the name of the menu is pass to the block functions not the menu functions.

Any ideas?

Frank

Different Header Images for Different Nodes

Drupal provides same header for the whole site and if we want to theme all the nodes individually then it’s a bit complicated process. While looking for alternatives to this, the following snippet work fine, this has been implemented in www.vinrcorp.com you can see the example before using it. The usage of the snippet is also quit simple just put this code into the header part or where ever you want, of page.tpl.php file of your theme.

<table>
  <tr>
    <td><img src="[path to image folder]/images/<?php
	if ($node->nid == 1) {
	print 'image-1.jpg" />';
	}elseif ($node->nid == 2){
	print 'image-2.jpg" />';
	}elseif ($node->nid == 3){
	print 'image-3.jpg" />';
	}elseif ($node->nid == 4){
	print 'image-4.jpg" />';
	}elseif ($node->nid == 5){
	print 'image-5.jpg" />';
	}elseif ($node->nid == 6){
	print 'image-6.jpg" />';
	}elseif ($node->nid == 7){
	print 'image-7.jpg" />';
	}elseif ($node->nid == 8) {
	print 'image-8.jpg" />';
	}elseif (($node->nid == 9) | ($node->nid == 10)){
	print 'image-9.jpg" />';
	}elseif ($node->nid == 11) {
	print 'image-11.jpg" />';
	}else {
	print 'default-image.jpg" />';
	}?>
 	</td>
  </tr>
</table>

To use it just put images in the image folder and mention the path in the code and also replace the names of images as per the node ids. This will help you to display different banner images for different nodes.

Different Header Images for Different Nodes

Drupal provides same header for the whole site and if we want to theme all the nodes individually then it’s a bit complicated process. While looking for alternatives to this, the following snippet work fine, this has been implemented in www.vinrcorp.com you can see the example before using it. The usage of the snippet is also quit simple just put this code into the header part or where ever you want, of page.tpl.php file of your theme.

Only local images are allowed.
	if ($node->nid == 1) {
	print 'image-1.jpg" />';
	}elseif ($node->nid == 2){
	print 'image-2.jpg" />';
	}elseif ($node->nid == 3){
	print 'image-3.jpg" />';
	}elseif ($node->nid == 4){
	print 'image-4.jpg" />';
	}elseif ($node->nid == 5){
	print 'image-5.jpg" />';
	}elseif ($node->nid == 6){
	print 'image-6.jpg" />';
	}elseif ($node->nid == 7){
	print 'image-7.jpg" />';
	}elseif ($node->nid == 8) {
	print 'image-8.jpg" />';
	}elseif (($node->nid == 9) | ($node->nid == 10)){
	print 'image-9.jpg" />';
	}elseif ($node->nid == 11) {
	print 'image-11.jpg" />';
	}else {
	print 'default-image.jpg" />';
	}

To use it just put images in the image folder and mention the path in the code and also replace the names of images as per the node ids. This will help you to display different banner images for different nodes.
I think you can use it and this works for you too. You can reply to this post for further help.

BlueMarine Question

Hi All

Fairly new here, working on a theme. I cannot figure out where the horizontal line that is going across the middle of the header in BlueMarine is coming from....is it a border? image? two divs not lining up?

I believe it is in the middle of the $header content that is the 2nd row of the header table. I've scoured the css and just can't figure it out. Where is $header constructed and what css does it use? Any chance one of you CSS experts know where this mysterious line comes from? ('cause I want to KILL IT)

Thanks,
Baer

Pages

Subscribe with RSS Subscribe to RSS - Theme development