Hi,
My content types:
Item
-- title
-- author (reference to node)
-- category
-- CCK field
category
-- title
-- year using taxonomy (e.g. 2010, 2009...)
author
-- title
-- type (member, editor...)
I can't use views to search my site, for I want a site-wide search. With the above data, an 'item' does not have a date, only a 'category' has. Setting a filter to '2010' therefore does not apply on items, and this will confuse the user.
So I did not find a module that allows the user to enter a term in a search field, returning all items, categories and/or authors with that name. This in fact works with the search core in Drupal 6. So, quite pleased with it.
However, I can't find a way to modify the search results the way I want to. Suppose that an item is returned as a result. I would like to show the following
Item1
-- 'this is a title'
-- Author X
-- 2010
-- CCK field
I managed to print the CCK field using:
<?php if ($result['node']->cck_field[0]['value']): ?>
<?php print($result['node']->cck_field[0]['value']); ?>
<?php endif; ?>
1. I don't know how to add the author name, which is a node reference. I can only print the 'value' which is the ID. I can't manage to pull out the title of the author. Hence, first question: what's the code to print a node reference?
2. How do I print not only the node reference, but specific fields of the referenced node? Here, this would be the year of a referenced category when an item is returned?
3. How do I print a taxonomy term? Again, I know how to print the number of the taxonomy term, but not the term itself. So what's supposed to be the code for a term?