[drupal-devel] [feature] make format_name themable
Bèr Kessels
drupal-devel at drupal.org
Fri Jul 29 15:59:21 UTC 2005
Issue status update for
http://drupal.org/node/27737
Post a follow up:
http://drupal.org/project/comments/add/27737
Project: Drupal
Version: cvs
Component: theme system
Category: feature requests
Priority: normal
Assigned to: killes at www.drop.org
Reported by: killes at www.drop.org
Updated by: Bèr Kessels
Status: patch
NM. just me being confused. I have been workingon some complex
(multilinugal) things lately. Somehow that flooded my mind. I guess.
I tested this, to theme an icon of teh user (avatar) in front of the
usernames. on newsphoto.nl we want to present everyone with images.
(teh dev site is not public, so I cannot show the result, yet)
Bèr Kessels
Previous comments:
------------------------------------------------------------------------
Fri, 29 Jul 2005 01:43:18 +0000 : killes at www.drop.org
Attachment: http://drupal.org/files/issues/theme_format_name.patch (20.39 KB)
I've always disliked that I cannot chose which user information is
displayed to the outside world. I often prefer to show "Firstname
Lastname" rather than a often cryptic username. I could of course
change this display in the node and comment functions of my theme, but
then it would be confusing if the same user essentially has another
name in the user search or the admin interface. Therefore I propse to
make format_name a themabel function. Patch attached.
------------------------------------------------------------------------
Fri, 29 Jul 2005 01:50:06 +0000 : moshe weitzman
makes sense to me.
------------------------------------------------------------------------
Fri, 29 Jul 2005 03:33:23 +0000 : Steven
theme('format_name') is a bit weird... why not have theme('name') ?
Oh and this might be a good time to change it so that it uses
drupal_substr() and drupal_strlen() to cut off the username. This would
mean the visual string length before chopping is more consistent.
------------------------------------------------------------------------
Fri, 29 Jul 2005 06:45:29 +0000 : Dries
Better would be theme('username'), I think. "format_" is redundant in
combination with "theme", but "name" is a bit too generic a name, I'd
say. Otherwise it looks good. Not tested though.
------------------------------------------------------------------------
Fri, 29 Jul 2005 11:48:14 +0000 : killes at www.drop.org
Attachment: http://drupal.org/files/issues/theme_username.patch (20.05 KB)
Ok, implemented the suggested changes.
Since it did get such a warm welcome, how about doing the same to the
format_date function and removing the various settings (everythign but
time zone) associated with it?
------------------------------------------------------------------------
Fri, 29 Jul 2005 12:01:55 +0000 : Bèr Kessels
I tried this patc hon a dutch localised system. It works as expected. I
like it.
A question though, which also applies to the recently introduced patch
to move date settings to locales:
Unglish native speakers will now need to enable localisation, just for
the sake of changing small things like the date, or, in this case, the
name.
However, personally I do not really mind that, since I use locale on
all my sites anyway. But others might not like that (performance)
penalty. Ideas?
------------------------------------------------------------------------
Fri, 29 Jul 2005 12:10:47 +0000 : killes at www.drop.org
thanks for testing.
Why do you think that you'd need to enable locale.module for changing
the name?
You need to implement a themable function in your theme, that's it.
More information about the drupal-devel
mailing list