Hi (again),

I've been experimenting with the theme() function, and am so far finding it quite easy to customize certain parts of my site further. I created a new function to handle the display of profile data, but it only seems to work for displaying just that. Ie: It'll customise any profile fields, but when you view the page the username doesn't seem to be a part of that. So I end up with the username being displayed in one way, and the rest of the profile in another way.

Is there any way I can modify things so the username gets put in with the rest of the profile data for displaying all at the same time?

Thanks,
Romano

Comments

moshe weitzman’s picture

the user.module is responsible for outputting username field, as well as a couple others I think. Find the spots where that happens user_edit() I think, and factor out the rendering part to its own function, user_edit_render(), which is then called via theme().

my initial thoughts, anyway.

shane’s picture

This isn't technically going to be very helpful ... but you might consider writing an admin module, which creates a method to configure which of the sub themes is the default smarty-sub theme. The Polder theme has a separate Admin module widget -- I've never gotten polder to do much of use for me, so I don't have any details of how it works or whether it's a good example of creating a theme admin module for you.

If you want to provide a user selectable list, you'll probably have to hack the user module to support the subdirectory structure you setup. I'm not sure how pervasive the directory structure is throughout the Drupal code - so it may be a fruitless effort.

Duplicating the directory structure as Weitzman is certainly one way that'll work - just rather brute force.

Dries’s picture

The Polder theme has a separate Admin module widget -- I've never gotten polder to do much of use for me, so I don't have any details of how it works or whether it's a good example of creating a theme admin module for you.

If you are using Drupal 4.1.0, creating a Polder-style configuration module is likely the way to go. In Drupal CVS (but not in Drupal 4.1.0), themes can implement the settings hook to export settings just like modules do.

Duplicating the directory structure as Weitzman is certainly one way that'll work - just rather brute force.

I have used a "duplicate directory + use symbolic links to share common files"-approach before which worked just fine.