Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
hi guys
i have a custom use profile file for the user pages, how can i print the box and statuses on the users page within my tpl file?
any help would be much appreciated thank you
Comments
Comment #1
IceCreamYou CreditAttribution: IceCreamYou commentedAPI documentation is here (but use
statuses
instead offacebook_status
where it appears on that page). It is usually good practice to use a preprocess function (perhaps in template.php in your theme) to store the output of calling a theme function in a variable that will be exposed to your template file, rather than calling functions in the template file directly.Comment #2
prezaeis CreditAttribution: prezaeis commentedThank you very much
Im not very good at programming and quite new to template overrides, so using the template.php would probably be too hard for me, thats why im just using theme files
Comment #3
prezaeis CreditAttribution: prezaeis commentedHia
I am using the code in my user-profile.tpl.php to print the status form
theme('statuses_form_display', array('context' => NULL, 'type' => NULL, 'view' => 'fbss_ur_stream', 'display' => 'page'))
but when i load the user page i get a popup message which reads 'The page at site.com says: dsds'
I click ok and get another popup message (this time with a checkbox that says to stop further messages) that says 'The page at site.com says: asas'
I click ok, but no form is displayed on the page. Am i doing something wrong?
Thank you
Comment #5
prezaeis CreditAttribution: prezaeis commentedwhy are you closing this when you can clearly see that the issue is NOT fixed
Comment #6
IceCreamYou CreditAttribution: IceCreamYou commenteddrupal.org automatically closes issues that have been marked as fixed if there are no comments for 2 weeks
I'm actually not sure if you can use theme functions directly in a .tpl.php file; at a minimum I'm pretty sure the required JS and CSS won't get added at that stage. The recommended way is to expose a variable via template.php.
Also, make sure you're
echo
/print
-ing the return value and not just calling the function.