How to includeing Profile sidebar in user profile in a new single page

Permalink 1 user found helpful
I create a single page under the profile for user News, but when i try to add the User Profile Sidebar to the new "News" page, the page either doesn't show nothing or doesn't load the sidebar at all.
here are diffrent ways that i tried,
<?php  Loader::element('profile/sidebar', array('profile'=> $ui)); ?>

<?php  $this->inc('profile/sidebar'); ?>

<?php include("sidebar.php"); ?>


Any help from and C5 Guru much appreciated,

QSC
 
cmscss replied on at Permalink Reply
Did you ever figure this out?

I have a custom member edit page I've overridden at the top-level single-pages and have copied /profile/sidebar into my top-level elements page and noting displays.
QSC replied on at Permalink Reply
QSC
I still couldn't find any way to do this and based on my research,there is no way to add the profile sidebar in any single pages under profile unless you create an Add-On for that specific page.

the other way that i was kinda had success was to add a "Auto Nav" to the pages manually and styles them.

hope that works for you...
mkly replied on at Permalink Reply
mkly
hmmm...
<?php
  $u = new User();
  $ui = UserInfo::getByID($u->getUserID());
?>
<?php Loader::element('profile/sidebar', array('profile' = $ui)) ?>


I wonder if you don't have anything(usually the controller) setting $ui?
cmscss replied on at Permalink Reply
Thanks for that,

For some reason I didn't have $ui in there.

Cheers

Ben
cmscss replied on at Permalink Reply
Hmm, it now works and shows the sidebar but also displays part of the website header again.

The confusing thing is that the view template doesn't have $ui and works fine (in fact, doesn't work with $ui in it).

view.php works great like this:
<?php // loads from /elements/profile/sidebar.php
  Loader::element('profile/sidebar', array('profile'=> $profile));
?>


edit.php doesn't work with the above but works with this (but displays part of the header twice):
<?php // loads from /elements/profile/sidebar.php
  Loader::element('profile/sidebar', array('profile'=> $ui));
?>


Does anyone know the correct way to load the member sidebar?

Cheers

Ben
cmscss replied on at Permalink Reply
For my own ref, I had a call to the website header.
geekeboy replied on at Permalink Reply
Sorry if this is too late, but if this helps, but it works on mine
<?php
  $u = new User();
  $profile = UserInfo::getByID($u->getUserID());
?>
   <?php  Loader::element('profile/sidebar', array('profile'=> $profile)); ?>