I have a user with a long (real name as user) name - the "Submitted by" under her blog posts is truncating it as "Submitted by Firstname La...". There is extra space in the container - the author and date don't fill the entire width, but it's cutting off the name before the date field. How can I make it show the full user name? I can't tell from searching whether this needs to be fixed in the theme css or in the template files or what. It's not even an unusual name.
You can see it here: http://www.coveragelawblog.com/?q=node/13
I think it's by design. theme_username() truncates long user names (>20 chars) so it won't break layout. You may want to modify or override it with your-theme_username().
On 6/6/07, Jean Gazis jgazis@gmail.com wrote:
I have a user with a long (real name as user) name - the "Submitted by" under her blog posts is truncating it as "Submitted by Firstname La...". There is extra space in the container - the author and date don't fill the entire width, but it's cutting off the name before the date field. How can I make it show the full user name? I can't tell from searching whether this needs to be fixed in the theme css or in the template files or what. It's not even an unusual name.
You can see it here: http://www.coveragelawblog.com/?q=node/13
-- Jean Gazis www.jeangazis.com www.boxofrain.us
"Believe those who are seeking the truth; doubt those who find it." - André Gide -- [ Drupal support list | http://lists.drupal.org/ ]
That is probably because theme_username purposely truncates usernames. In the code it is documented as "Shorten the name when it is too long or it will break many tables."
If you wanted to override this, you could define a new function in the template.php file of your theme. To do this, simply copy the of the existing function from <http://api.drupal.org/api/5/function/ theme_username> and rename it to your-theme's-name_username. Then depending on what you want to do, you could simply comment out the line
$name = drupal_substr($object->name, 0, 15) .'...';
or change the value (15) to something long enough to allow the user's name to not be truncated. You could even code it so that, only this user's name is exempt from the filter, or subject to different filtering.
Hope this helps
-Mikey P
On Jun 6, 2007, at 2:13 PM, Jean Gazis wrote:
I have a user with a long (real name as user) name - the "Submitted by" under her blog posts is truncating it as "Submitted by Firstname La...". There is extra space in the container - the author and date don't fill the entire width, but it's cutting off the name before the date field. How can I make it show the full user name? I can't tell from searching whether this needs to be fixed in the theme css or in the template files or what. It's not even an unusual name.
__________________ Michael Prasuhn mike@mikeyp.net http://mikeyp.net 714.356.0168
I actually changed the line above like this:
if (drupal_strlen($object->name) > 22) { $name = drupal_substr($object->name, 0, 15)
- where the 22 used to be 20. She happens to have a 21-letter name, what are the odds? (Probably not actually that small.)
Anyway, it seems to have worked fine. Thanks to you and whoever else it was that answered my question.
Jean Gazis
On 6/6/07, Michael Prasuhn mike@mikeyp.net wrote:
That is probably because theme_username purposely truncates usernames. In the code it is documented as "Shorten the name when it is too long or it will break many tables."
If you wanted to override this, you could define a new function in the template.php file of your theme. To do this, simply copy the of the existing function from http://api.drupal.org/api/5/function/ theme_username and rename it to your-theme's-name_username. Then depending on what you want to do, you could simply comment out the line
$name = drupal_substr($object->name, 0, 15) .'...';
or change the value (15) to something long enough to allow the user's name to not be truncated. You could even code it so that, only this user's name is exempt from the filter, or subject to different filtering.
Hope this helps
-Mikey P
On Jun 6, 2007, at 2:13 PM, Jean Gazis wrote:
I have a user with a long (real name as user) name - the "Submitted by" under her blog posts is truncating it as "Submitted by Firstname La...". There is extra space in the container - the author and date don't fill the entire width, but it's cutting off the name before the date field. How can I make it show the full user name? I can't tell from searching whether this needs to be fixed in the theme css or in the template files or what. It's not even an unusual name.
Michael Prasuhn mike@mikeyp.net http://mikeyp.net 714.356.0168
-- [ Drupal support list | http://lists.drupal.org/ ]