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,
Any help from and C5 Guru much appreciated,
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,
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...
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...
hmmm...
I wonder if you don't have anything(usually the controller) setting $ui?
<?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?
Thanks for that,
For some reason I didn't have $ui in there.
Cheers
Ben
For some reason I didn't have $ui in there.
Cheers
Ben
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:
edit.php doesn't work with the above but works with this (but displays part of the header twice):
Does anyone know the correct way to load the member sidebar?
Cheers
Ben
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
For my own ref, I had a call to the website header.
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)); ?>
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.