This forum is for assistance with theme development.

phpTemplate: '$title' conditional placement in node.tpl vs. page.tpl ?

I'm working on a site that has some interesting challenges in layout that would be made much much easier if I could get the title on the front page and the title on node pages to get called up in the same way.

With page.tpl.php the title variable is called thus:

				<?php if ($title != ""): ?>
					<h2 class="content-title"><?php print $title ?></h2>
				<?php endif; ?>

Some way further down, the $content is called.

In node.tpl.php the title variable is called thus:

 <?php if ($page == 0): ?>
    <h2><a href="/<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?></a></h2>
  <?php endif; ?>

I am assuming there must be good reasons for this, but I'm too new at the code structure (or I'm just too dense) to figure it out.

My question is this: Is there an essential reason why the title variable is called by node vs. page using mutually exclusive conditionals? Would there be potentially dire (and/or unforseen) consequences to simply call ALL $title calls via node.tpl.php (without the conditional), and take out the $title call in page.tpl.php altogether?

I suppose I will just give it a shot in the morning, but what I'm afraid of is that it will seem to work, only to surprise me later.

Any thoughtful reply would be greatly appreciated!

Goofy Forum Posting in IE on Mac?

I'm kind of a newbie with Drupal 4.5.2 and I've been playing with a bunch of modules and themes. Right now, I'm wanting to use Goofy, but am experiencing problems though they don't seem to be exactly like those noted in forum posts.

Making $node->type or similar available in page.tpl.php

Hi all. What I am wanting to do is make the display of the node title conditional on the node type in a phptemplate theme. The only stumbling block is that information about the node type is not available within page.tpl.php. The node object does not exist within _phptemplate_callback() either, so I am unable to use _phptemplate_variables() to add the type information to vars[]. Is there another way to get access to the node type?

I suppose I could create a new module with it's own template but that seems like overkill.

Block borders.

OK, I've made myself a new theme and I'm running in to an unpredictable problem. I've tried troubleshooting it buy modifying html, styles, showing/hiding various blocks, and moving around the blocks. Check out my blocks at:

http://www.electroniclife.org/

You'll see that the "Who's online" block title is missing it's top border. I just checked this in IE and it looks fine, so it appears to only be a problem in firefox. ;-{

Send email via form

maybe somebody can give me example of form and file that sending email in drupal (using windows)

thanks

How does $content decide when to display the $node->body or $node->teaser?

I am using phptemplate and I can't seem to access $node->teaser and $node->body separately with any reliability -- only $content, which seems to represent either the teaser or the body depending on some other criteria of which I have seem to have no control.

I am trying to make /taxonomy/term/1 list just the title and teaser of each node, but I want /taxonomy/term/2 to show the title and full body of each node.

Pages

Subscribe with RSS Subscribe to RSS - Theme development