0

I would like to know if there is a way to reset a node's properties/fields?For example node's body, title,attachments, so as to re write the contents of the page.

3
  • you mean editing it? surfing over to www.jonssite.com/node/####/edit where #### is the nid will do that.
    – Jimajamma
    Commented Aug 15, 2012 at 14:59
  • No Just for display.
    – Jons
    Commented Aug 15, 2012 at 15:20
  • can you give a more concrete example of what you are trying to do?
    – Jimajamma
    Commented Aug 15, 2012 at 15:49

1 Answer 1

0

In your theme folder you can override the default output using custom template files.
Let's say you want to modify the output of a standard 'Page' (the machine name for this content type is 'page' -- you can check it in /?q=admin/structure/types).
Go to your theme folder (under /sites/all/themes) and add/modify 'node--page.tpl.php' file.
A standard node template file will have something like:

<?php print render($title_prefix); ?>
<?php if (!$page): ?>
<h2<?php print $title_attributes; ?>>
  <a href="<?php print $node_url; ?>"><?php print $title; ?></a>
</h2>
<?php endif; ?>
<?php print render($title_suffix); ?>


This piece of code is used to show the title of the current content. You can delete (or comment) the entire code and your title won't appear when you display this page.
To hide the entire content (including custom fields attached to this content type) simply comment (or delete) this line:

print render($content);


After that, you can add your custom code to display anything in place of the original title (or content) for this page.

You can find an extensive tutorial on working with custom themes here: Theming Guide

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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