CCK-formatters make up the code and are thus capable of displaying the fields the way a coder wants it. Website developers often come short of formatters, when performing tasks. In this article I will offer a review of creating the formatter for noderefence field, which will simply be adding anchor to the link.
First we are to announce the formatter by causing the hook_field_formatter_info ():
/** * Implements of hook_field_formatter_info(). * * Here we define an array with the options we will provide in display fields page * The array keys will be used later in hook_theme and theme_ */ function example_field_formatter_info() { $formatters = array( 'nodereference_anchor' => array( // The name that the user will choose in the display fields configuration page. 'label' => t('Link(with anchor)'), // An array with the types of cck fields that the formatter supports. 'field types' => array('nodereference'), 'description' => t('Displays a link to the referenced node with anchor.'), ), ); return $formatters; }