New theme function created for this one. theme_profile_wrapper now wraps all the profile listings. Originally hard coded into profile_browse. This new function also suggests a template name based on the profile being viewed.

Unsure if this is acceptable but for profile-block.tpl.php and profile-listing.tpl.php, there are named variables so each field can be printed directly. It's not used by default. For now it will loop through the available fields.

For example, a field configured with a name of "profile_state" would result in a variable of $profile_state being available. With that, the themer can do a direct print of $profile_state->title or $profile_state->value.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dries’s picture

Status: Needs review » Needs work

I have the same comments then I had with your other tpl patch.

1. Let's be more explicit about what 'raw' means.

2. It's not clear what you mean with "@see profile-wrapper.tpl.php for its' wrapper markup and options.". -- 'its+$accent' doesn't seem correct.

3. It's profile-wrapper.tpl.php (dash) not profile_wrapper.tpl.php (underscore). What is meant with "wrapping profile listings"? A listing is a full-page so why does it need an additional wrapper?

4. It looks like we're not escaping certain variables. Needs a closer look.

dvessel’s picture

Okay Dries, thanks for the feedback. I'll put up another over the weekend.

dvessel’s picture

FileSize
11.15 KB

The wrapper function was added since it was hard coded before and could not be overridden. Just like comment wrapper, it wraps all the items. Won't be used much but that darn HTML needed to be moved. Who knows, someone could create a set of variable functions to add to that wrapper to output more content.

This patch depends on the user patch due to a single function change. http://drupal.org/node/161510

dvessel’s picture

Status: Needs work » Needs review

whoops

bennybobw’s picture

Patch code fails on HEAD after applying user patch.

patching file modules/profile/profile.module
Hunk #2 FAILED at 451.
bennybobw’s picture

Status: Needs review » Needs work

1. I would change - $picture: Image of the account rendered through theme_user_profile(). To "$picture: The user's image rendered through theme_user_profile()."

2. $item->type: Type of teh profile item. i.e. checkbox, textfield, should be "Type of the profile item"

3. Dries 1st comment in #1 still hasn't been addressed. I agree, "raw account information" is not very descriptive.

4. "An alternate template name is also based on this. "profile-wrapper-profile_name.tpl.php" would be used when viewing the example address and the template existed for the theme." Why not change this to something like: "This is also used to override the default template. Placing "profile-wrapper-profile_name.tpl.php" in your theme would override the default template when viewing the example address."

5. "// Extract the affected users:" to "// Get the affected users" or maybe "// Get active users"

These are just some suggestions. Good work!

dvessel’s picture

Status: Needs work » Needs review
FileSize
11.16 KB

Your looking at the wrong patch.

Here's another, I left out a single $item variable causing errors.

dvessel’s picture

FileSize
10.78 KB

Changed how variables are created. All keyed now.

Dries’s picture

Status: Needs review » Fixed

Committed to CVS HEAD. Thanks.

dvessel’s picture

Don't forget to remove all the old templates files.

Was my pleasure. :)

Anonymous’s picture

Status: Fixed » Closed (fixed)