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.
Comment | File | Size | Author |
---|---|---|---|
#8 | tplify_profile_3.patch | 10.78 KB | dvessel |
#7 | tplify_profile_2b.patch | 11.16 KB | dvessel |
#3 | tplify_profile_2.patch | 11.15 KB | dvessel |
tplify_profile_1.patch | 10.51 KB | dvessel | |
Comments
Comment #1
Dries CreditAttribution: Dries commentedI 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.
Comment #2
dvessel CreditAttribution: dvessel commentedOkay Dries, thanks for the feedback. I'll put up another over the weekend.
Comment #3
dvessel CreditAttribution: dvessel commentedThe 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
Comment #4
dvessel CreditAttribution: dvessel commentedwhoops
Comment #5
bennybobw CreditAttribution: bennybobw commentedPatch code fails on HEAD after applying user patch.
Comment #6
bennybobw CreditAttribution: bennybobw commented1. 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!
Comment #7
dvessel CreditAttribution: dvessel commentedYour looking at the wrong patch.
Here's another, I left out a single $item variable causing errors.
Comment #8
dvessel CreditAttribution: dvessel commentedChanged how variables are created. All keyed now.
Comment #9
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #10
dvessel CreditAttribution: dvessel commentedDon't forget to remove all the old templates files.
Was my pleasure. :)
Comment #11
(not verified) CreditAttribution: commented