By Mist on Friday, 06 June 2014
Posted in Technical Issues
Replies 9
Likes 0
Views 694
Votes 0
Why the including of default header instead of mini-profile header is generating errors (white pages) ?

I try to include the default header containing cover section across the entire profile system by using the code below

<?php echo $this->includeTemplate( 'site/profile/default.header' ); ?>


and i get white pages.

For example, i tried to use this code in the followers profile section (followers/default.php) aswell as in other places but with no luck.

Any tips on how can i sucesfully implement the "full header" inside profile "sub-sections" ?
Hello Mist,

You need to pass the set of arguments over to the header template. For instance,


<?php echo $this->loadTemplate( 'site/profile/default.header', array('user'=> Foundry::user())); ?>
·
Friday, 06 June 2014 11:16
·
0 Likes
·
0 Votes
·
0 Comments
·
No luck, getting the same white pages when using the code below

<?php echo $this->loadTemplate( 'site/profile/default.header', array('user'=> Foundry::user())); ?>


It's strange, the header include should work flawless in the entire profile template sub-pages. (sections)
·
Saturday, 07 June 2014 19:11
·
0 Likes
·
0 Votes
·
0 Comments
·
Please turn on error reporting to maximum and see if there's any errors generated.
·
Sunday, 08 June 2014 15:19
·
0 Likes
·
0 Votes
·
0 Comments
·
I turned error reporting to maximum and then to development.
On followers page i didn't get any errors just one notice coming from ReDJ plugin (nothing to do with EasySocial and i think it's not affecting it)

Notice: Undefined index: PATH_INFO


other than that ... just a plain white page.

If i remove the line for header include .... everything start to work immediately
·
Sunday, 08 June 2014 21:55
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Mist,

Hm, try to view the source of the page. Quite often these errors are being hidden because the browser "misinterpreted" them
·
Monday, 09 June 2014 01:11
·
0 Likes
·
0 Votes
·
0 Comments
·
So, here is the update on this

I tried to implement the ES header in "followers" profile page like this

I put this code
<?php echo $this->loadTemplate( 'site/profile/default.header', array('user'=> Foundry::user())); ?>


inside this file

/templates/my_template/html/com_easysocial/followers/default.php


I got white page error and then i tried to turn on the error reporting to "development" and i got this in the page source code


Notice: Undefined variable: cover in /home/development/public_html/mydomain.com/templates/my_template/html/com_easysocial/profile/cover.php on line 16
Fatal error: Call to a member function getSource() on a non-object in /home/development/public_html/mydomain.com/templates/my_template/html/com_easysocial/profile/cover.php on line 16


I also tried this code

<?php echo $this->loadTemplate( 'site/profile/default.header', array( 'user' => $currentUser ) ); ?>


... same thing, same error.
·
Monday, 28 July 2014 18:24
·
0 Likes
·
0 Votes
·
0 Comments
·
The reason is because some php variables doesn't exist on the page that you are including the template file. You can use the codes below if you are on the latest version,


<?php echo $this->html('html.miniheader', $user); ?>


The $user object needs to be the type of SocialUser or SocialGroup and it will load the respective headers accordingly.
·
Monday, 28 July 2014 19:54
·
0 Likes
·
0 Votes
·
0 Comments
·
Mini header works fine but i am trying to use the "full" header instead so i can have a "consistent" profile header across all profile "subpages".

So there is no way i can include the full "regular" header in some other "subpages" or "sub-templates" of EasySocial ?

I need to include the full header on this template files

User Profile - Followers

/templates/my_template/html/com_easysocial/followers/default.php


User Profile - Points History

/templates/my_template/html/com_easysocial/points/default.history.php
·
Monday, 28 July 2014 23:45
·
0 Likes
·
0 Votes
·
0 Comments
·
If you want to include the full header, you need to make sure all variables are declared from your original theme file.
·
Tuesday, 29 July 2014 00:39
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post