Closed (fixed)
Project:
User Relationships
Version:
6.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
20 Jan 2009 at 19:45 UTC
Updated:
1 Jul 2009 at 08:34 UTC
Hi mainatainers,
I would like to know how to theme the user relation main page "/relations". I can´t find a theme funktion for it only a user_relationships.tpl.php. Is there a way to call this via the tempalte.php and change it?
Dirk
Comments
Comment #1
jaydub commentedhttp://drupal.org/node/341628
In Drupal 6 if a module provides a *.tpl.php file you should be able to copy that template file to your theme directory and then modify to your needs. The theming layer will first look for the a *.tpl.php file in your theme directory to use for the module in question before using the module's default *.tpl.php file in the module's directory.
hope that helps.
Comment #2
advseb commentedTheming doesn't seem to work. I copied the file "user_relationships.tpl.php" to my theme folder and refreshed the template cache. If I now view "My Relationships" page, no relationships are shown anymore. I haven't changed the user_relationships.tpl.php file at all. It seems that the "relationships" variable is not correctly initialised. I think it should get the same result as before if I just copy the user_relationships.tpl.php file to my theme folder.
Comment #3
j0rd commentedSame issue. Can confirm this. Something is Wonky with this tpl.php file. Never had this happen before.
If you clear the cache (via devel module) it works on the first load, and on sub-sequent loads the "$relationships" variable in the template is empty. Not sure what the issue is...but it sucks.
I'll provide a temp fix once I figure this out.
PS. The names for one way relationships are confusing. I'm chageing them to
Comment #4
j0rd commentednot sure how to fix, so for now i'm editing the user_relationships.tpl.php file directly in the user_relationships module folder.
Comment #5
alex.k commentedHmm, when I copy the template file to the theme directory I actually get a fatal error:
Is it what you're seeing, too?
Comment #6
j0rd commentedNo, but I also didn't have the elaborations module enabled.
Comment #7
designwork commentedHi all short instruction how to theme this.
1. copy the files user_relationshpis_pending_requests.tpl.php and user_relationships.tpl.php into your theme folder.
2. Copy the function template_preprocess_user_relationships(&$variables) and template_preprocess_user_relationships_pending_requests from user_relationships_ui.templates.inc to your template.php and rename them to mytheme_preprocess_user_relationships(&$variables) etc.
3. refresh the cache at admin/settings/performance.
Now it will work and you can override it.
More theming you can do writing your own module. Like you want to have the friendlist as subtab at user account.
1. Make a little module with an MY.info and an MY.module file see the acording handbookpages how to make this.
2. in your module wirte a menu function like:
3. you need a user function to make the subtab like:
4. In the hook menu we refered to a page in the page callback so we need to generate it like:
So guys hope this helps.
Cheers
Dirk
Comment #8
designwork commentedI close this thread as it is fixed
Dirk
Comment #10
alex.k commentedReopening to fix it properly in CVS. @DesignWork thanks for doing the troubleshooting
Comment #11
alex.k commentedCommitted a fix in CVS. Your solution is still the correct one; I just made it possible to only override the template files, without having to copy preprocess functions.
Comment #13
ktonini commentedThis still isnt working for me. Flushing the cache shows the correct template changes, but then on subsequent reloads I get "No Pending Requests."
The "No Pending Requests" string is from the template file though.
Any ideas?
Comment #14
alex.k commentedYour problem looks like #465752: drupal_rebuild_theme_registry required for block display I believe, not this bug.
BTW reopen an issue when you comment on a closed one - as it is this doesn't show up in any of issue queues.