By enjoy777 on
Hello
I created my template from scratch, everything is almost ok, I have one issue I can't solve myself.
This is comments problem. I have page.tpl.php file where I can display my nodes. And they are displayed in good way.
Under the node content are fields for writing comments by users. When user put comments in field and save the comment
the issue occures. Whole content of node disappear under the header of my page and I can see the new added comment.
The same situation is when I click on any link to any comment on my site so clickin on link eg. www.example.com/node#comment-1
I can see only header and below text of comment-1
Here is code of my page.tpl.php file
<?php // $Id: page.tpl.php,v 1.28 2008/01/24 09:42:52 goba Exp $ ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $language->language ?>" xml:lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>">
<head>
<?php print $head ?>
<title>
<?php print $head_title ?>
</title>
<?php print $styles ?>
<?php print $scripts ?>
<?php print $suy ?>
</head>
<body id="bezmisji">
<div id="body_footer_other">
<div id="ghost">
<div id="wraper">
<div id="breadcrumb">
<?php print $login ?>
</div><!-- eof breadcrumb -->
<div id="logo">
<a href="index.php"></a>
</div><!-- eof logo -->
<div id="mission">
<a href="index.php">Mission</a>
</div><!-- eof mission -->
<div class="clr"></div>
<div id="about">
<div id="top">
<?php print $top ?>
</div><!-- eof top -->
</div><!-- eof about -->
<div id="top_bar">
<div id="nasze_menu">
<?php print $o_nas ?>
</div><!-- eof nasze_menu -->
<div id="search">
<?php print $search_pole ?>
</div><!-- eof search -->
<div class="clr"></div>
</div><!-- eof top_bar -->
<div class="main_part">
<?php if ($menu_onas): print '<div id="menu_podrzedne">'. $menu_onas .'</div><!-- eof menu_podrzedne -->'; endif; ?>
<div class="clr"></div>
<?php if (($left)&&($right)) : ?>
<div id="container">
<?php elseif (($left)&&(!$right)) : ?>
<div id="container_left">
<?php elseif ((!$left)&&($right)) : ?>
<div id="container_right">
<?php else: ?>
<div>
<?php endif; ?>
<div id="center_column" class="column">
<?php print $content ?>
</div><!-- eof center_column -->
<?php if ($left): print '<div id="left_column" class="column">'. $left .'</div><!-- eof left_column -->'; endif; ?>
<?php if ($right): print '<div id="right_column" class="column">'. $right .'</div><!-- eof right_column -->'; endif; ?>
</div><!-- eof container -->
<div class="clr"></div>
<div id="pustak">
</div><!-- eof pustak -->
</div><!-- eof main_part -->
</div><!-- eof wraper -->
</div><!-- eof ghost -->
<div id="main_footer">
<?php print $footer ?>
<a href="rss.xml" id="rss"></a>
<div class="clr"></div>
<?php print $closure ?> </div>
<!-- eof main_footer --> </div>
<!-- eof body_footer -->
</body>
</html>
Comments
Hmm, so when someone
Hmm, so when someone publishes a comment, the node body stops showing? What happens if you post more than one comment?
Did you say that you wrote your theme from scratch? You might compare the node.tpl.php and comment.tpl.php to an existing theme to make sure you aren't missing something. I'm not sure what it would be off the top of my head, though.
Are you doing any custom overrides for comments in the template.php file?
Hello sun thanks for your
Hello sun
thanks for your reply.
When you post more commets than one. Hmmm the last comment is lifted up under the header and only this comment can be read below the page header. In Garland for example when you add comment you can see it but the whole page is moved to show you this comment. In my template it looks like the header is sticky in the browser and rest of the page is hidden/lifted up.
My node.tpl.php is below
<?php // $Id: node.tpl.php,v 1.4 2008/01/25 21:21:44 goba Exp $ ?> <div id="node-<?php print $node->nid; ?>" class="node<?php if ($sticky) { print ' sticky'; } ?><?php if (!$status) { print ' node-unpublished'; } ?> clear-block"> <?php if (!$page): ?> <h2><a href="<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?></a></h2> <?php else: ?> <h2><?php print $title ?></h2> <?php endif; ?> <div class="node_author"> <label class="node_author_label"> Dodane przez: </label> <span><?php print $name ?></span> </div> <div class="node_date"> <span><?php print $date ?> </span> <?php print $node->pages_count; ?> </div> <div class="clr"></div> <div class="meta"> </div> <div class="node_content"> <?php print $content ?> </div> <div class="separator"></div> <?php if ($terms): ?> <div class="terms terms-inline"><span>KATEGORIE:</span><?php print $terms ?></div> <div class="clr"></div> <?php endif;?> <?php print $links; ?> </div>I don't use custom comment.tpl.php
in template.php I have only code for Magic tabs module.