[support] Sorting problem
Michael Prasuhn
mike at mikeyp.net
Thu Jul 5 20:14:14 UTC 2007
My solution to this type of problem, (which I think is fairly common)
is to use the CCK Fullname field for the name, and use contemplate to
theme the node view to use this for display (and you can use views to
sort via the last name only field, and then use Node Autotitle to
generate the title for the node (used internally, or you can use this
for actual display and use the fullname field just for sorting (and
leave it hidden in the theme layer.
http://drupal.org/project/cck_fullname
http://drupal.org/project/auto_nodetitle
When configured, you can use a snippet of PHP in the auto_nodetitle
field something like the one below to get the fullname into the
node's title, and you can use auto_nodetitle to hide the title form
on the node creation page as well.
<?php
global $form_values;
$node = (array)$form_values;
$name = $node['field_full_name']['0'];
print $name['first'] .' '. $name['last'];
?>
Hope that helps
-Michael
On Jul 5, 2007, at 9:02 AM, A-NO-NE Music wrote:
>
> Drupal 5.1.
> I have a section where my musicians create their own profile. The
> default Name field is the musician's name. Now I have a problem
> sorting
> them by last name.
>
> I then relabeled Name field to Last Name, and added a new field called
> First Name. Now the title is only Last Name. I have played with
> Contemplate but to no avail.
>
> What is the best solution to this problem?
>
> --
>
> - Hiro
>
> Hiroaki Honshuku, A-NO-NE Music, Boston, MA
> <http://a-no-ne.com> <http://anonemusic.com>
>
>
> --
> [ Drupal support list | http://lists.drupal.org/ ]
__________________
Michael Prasuhn
mike at mikeyp.net
http://mikeyp.net
714.356.0168
More information about the support
mailing list