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: $node object description

Submitted by on October 3, 2011 – 1:30 pmNo Comment

In this article, we will study $node object which is available in node.tpl.php template to use it for adjusting of a node design.

Solution:

You can view content of a node with standard PHP functions (insert the following code to node.tpl.php):  print_r($node)

Variables of $node are:

  • body – document text
  • changed – a date of a change in Unix-format
  • comment – if comments are enabled. There are three values for this variable
  • comment_count – number of comments.
  • created – creation date in Unix-format (string(10) “1198024338”)
  • data – was NULL
  • files – attached files
  • format – input format number starting from 1.
  • last_comment_name – name of the last commenter
  • last_comment_timestamp – date of the last comment in Unix format
  • moderate – moderation flag. Equals to 0 if a node doesn’t require moderation.
  • name – name of an author
  • nid – id of a node
  • path – relative path synonym (“content/turpis-premo-inhibeo-abico-luctus”)
  • picture – user picture (chup)
  • promote – “on home”=1, otherwise=0
  • revision_timestamp – revision date in Unix-format
  • status – published= 1, otherwise=0
  • sticky – above the others =1, otherwise=0
  • taxonomy – parent of a node. This is an array.
  • teaser – teaser
  • title – node title
  • type – node type
  • uid – id of an author
  • vid – version id of a node. Doesn’t always equals to nid.

Additional modules

Additional modules could add their own variables to this object. These modules are:

  • CCK – every field you add will be a set of parameters
  • Nodeteaser – adds $node->nodeteaser, which is TRUE  or FALSE; the proper teaser is in $node->teaser.

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.