Hello!
So sorry to create an issue for this, but I've been looking at the API and searching the forums all day and am still totally stumped...
How do you use the hooks and theme functions to theme privatemsg?
If anyone can provide a working example of how to use this API I would be very grateful. For example, how would I add a "From" column to the inbox? I saw the forum from earlier this year where someone explained how to theme the module to look like gmail, but the latest replies indicate that the method used there is no longer valid.
Thanks and, again, my apologies.
- Ryan
Comments
Comment #1
berdirThere is already a From column, it's called Participants, since there can be more than a single author inside a thread. You can use string overrides if you want to rename it (http://drupal.org/project/stringoverrides).
If that was just an example and you actually want to do something else, then ask the right question :)
Since your original question is imho answered, I'm setting this to fixed. Feel free to re-open if you have more questions.
Comment #2
rschwab commentedThank you for the response Berdir and, more importantly, for maintaining this very wonderful module!
Let me ask a more specific question... How would I move the participants column to the left-hand side (left of subject), change the title to From (I can do it with string overrides, but since I imagine I'll be altering some data to do the others, I may as well do it here as well), and list only the author of the first message in the thread as the From user?
privatemsg_sql_list_alter()? But where, and how can I figure out what to put in the $fragments variable?
Thanks again!
- Ryan
Comment #3
berdirNow, these are questions I can answer ;)
First: Since you do not want to change the selected data, you don't need sql alter, all you need to do is override the theme functions.
Override http://blog.worldempire.ch/de/api/function/phptemplate_privatemsg_list_h... by creating a yourtheme_privatemsg_list_header__participants() function and change the weight to something lower than http://blog.worldempire.ch/de/api/function/phptemplate_privatemsg_list_h...
True. As you may have already found out, the above function also defines the column title so you can override that there too.
You can limit the list to a single entry, but that may or may not be the first author since this is a GROUP_CONCAT() and these cannot be sorted. This is hopefully going to change for the 2.0 version.
Anyway, you need to override http://blog.worldempire.ch/de/api/function/phptemplate_privatemsg_list_f... this time, and replace "-
4" to "-1" in the _privatemsg_generate_user_array() call.