[support] changing the display of the breadcrumb trail in blog module
Steve Edwards
killshot91 at comcast.net
Tue Dec 11 02:34:45 UTC 2007
Yes, you can use hook_view() (the code from the blog module is an implementation of hook_view).
http://api.drupal.org/api/function/hook_view/5
You just create the breadcrumb array the way it does below, replacing the appropriate element with the custom field data. I'm not
sure if custom fields become part of the $user object, so you might have to query the database to get the field you want. For
instance, if you were using the Profile module, you would need to query profile_fields and profile_values to get what you want and
then replace the user name with the custom field in the $breadcrumb array.
Steve
Sarah.Vardy at student.griffith.edu.au wrote:
> Hi,
>
> I was wondering if it's possible to alter this function in the blog
> module, so that it displays a custom field from the user's profile
> instead of the user name of the user:
>
> |<?php
> function blog_view($node, $teaser = FALSE, $page = FALSE) {
> if ($page) {
> // Breadcrumb navigation
> $breadcrumb[] = array('path' => 'blog', 'title' => t('Blogs'));
> $breadcrumb[] = array('path' => 'blog/'. $node->uid, 'title' =>
> t("@name's blog", array('@name' => $node->profile_displayName)));
> $breadcrumb[] = array('path' => 'node/'. $node->nid);
> menu_set_location($breadcrumb);
> }
> return node_prepare($node, $teaser);
> }
> ?>|
>
> Any help would be great!
>
> Sarah
>
More information about the support
mailing list