Drupal: .htaccess Access Deny
August 21, 2014 – 7:59 am | No Comment

In this article I will tell how to forbid access to certain resources for some clients. The instructions will include descriptions of different directives.

Read the full story »
CSS Templates

Contain reviews and news about CSS Templates.

Freebies

Contain freebies such as icons, graphics, headers and images for your websites.

Fun Stuff

Contains other fun stuff for entertainment or interesting site showcase.

How-To

Contain technical elaborations on some specific workarounds or common tweak.

Joomla Templates

Contains reviews and news about Joomla templates.

Home » How-To

Drupal: How to Hide or Disable Blank Comment Subject

Submitted by on April 9, 2010 – 8:36 amOne Comment

This article would tell you how to disable an ability to change comment subject when comment adding and how to do not show the subject on the node page in the list of all.

 

Solutions:

  • Use standard Drupal tools
  • Use “Re: Comment subjects” module
  • Hide subjects through CSS
  • Use "Comment automatic title" module
  • Use hook_comment()

Use hook_comment()

  • It is necessary to catch comment form output and disable subject output.
  • Catch subject validation or automatically make it unnecessary when installing the module. Or – it would be even better – show the list of node types and let administrator to choose the required types.
  • Catch comment output and remove the subject.

Use "Re: Comment subjects" module

This is the module page: Re: Comment subjects.

The module automatically generates comment subject. Unfortunately, subjects are similar for the same node in the last comments, if RE:[node title] mode is used.

Use "Comment automatic title" module

The module page is: Comment automatic title.

Setting of length to 0 does nothing – comment title is generated and displayed.

Use the standard Drupal tools

  • In settings of the required node type, make comment’s title unnecessary for user.
  • Delete the following row in comment.tpl.php file:
    <?php print $title ?>

Hide titles through CSS

Add the following to style.css:
#comments h3.title {
display:none;
}

Summary

Blank comment titles can be filled in automatically (if you have the required modules for this), or disable/hide titles displaying. You can choose the appropriate solution which meets you requirements.

One Comment »

  • Robert Cottrell says:

    Hiding through CSS …

    #comments .form-item-subject {display:none;}

    … is what worked for me

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.