0

I use advanced forum but it uses default Drupal title method.

I know there is a module called Comment subjects for this purpose but I need to do it in this way.

I would be grateful if anyone could help me.

 if $title >avalible print $title
 if $title disabled print <h3><a href="#<?php echo $comment->cid; ?>"> Re: <?php print $node->title ?></a></h3>

OR

 if > node print $node->title
 elseif comment $print <h3><a href="#<?php echo $comment->cid; ?>"> Re: <?php print $node->title ?></a></h3>
1

Found the Solution.

Go to -> (advanced_forum/styles/naked/advanced-forum.naked.post.tpl.php)

  <?php if (!empty($title)): ?>
    <div class="forum-post-title">
      <?php print $title ?>
    </div>
  <?php endif; ?>

Then replace it with:

<?php if (!empty($title)): ?>
    <div class="forum-post-title">
        <?php print $title; ?>              
    </div>
<?php else: ?>      
    <div class="forum-comment-title">
        <h4><a href="#comment-<?php print $comment->cid; ?>"> Re : <?php print $node->title ?></a></h4>
    </div>
<? endif; ?>
1
  • 1
    I think you have a XSS vector in the title printing - it should be run through check_plain(). Personally I always try to avoid using a template if I can achieve the same effects by using a preprocess and modifying variables (which in this case is easily possible by modifying $vars['title']). – Andy Aug 6 '12 at 10:14
0

When you disable the title tag does the node have value? Because if it does, all you need to do is adding an control statement.

if ($node->title[array values] == the disabled value) {
  // What I need to print here.
}
else {
  // Print the rest.
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.