Profile subpages
Permalink
I'd like to add a fifth subpage to the profile. I'd also like to merge the Avatar and Edit pages to a "Settings" page.
After browsing the forums I have been unable to find out how to do either of these things correctly. I've merged the edit and avatar pages, presenting the contents of both at "Avatar," but I'm afraid by doing that I'll mess a bunch of stuff up on the edit page, where the user attributes are found. I've tried adding the fifth page through the sitemap, but this only adds a fifth page as it would any other subpage, not the profile section. I'd like the profile sidebar auto nav to say:
Member Name
Profile
Friends
Mail
Files
Settings
Any ideas? Thanks!
After browsing the forums I have been unable to find out how to do either of these things correctly. I've merged the edit and avatar pages, presenting the contents of both at "Avatar," but I'm afraid by doing that I'll mess a bunch of stuff up on the edit page, where the user attributes are found. I've tried adding the fifth page through the sitemap, but this only adds a fifth page as it would any other subpage, not the profile section. I'd like the profile sidebar auto nav to say:
Member Name
Profile
Friends
Files
Settings
Any ideas? Thanks!
But I'm still not sure how to correctly merge edit.php and avatar.php. I'm thinking about condensing each set of these files in controllers/profile and single_pages/profile. Will that work?
No response yet? I'd like to know as well.
1. I copied /concrete/controllers/profiles to controllers/profile and /concrete/single_pages/profile to single_pages/profile.
2. I created files.php, to add to controllers/profile, with some basic cut-and-pasted code from controllers/profile/edit.php:
<?php
defined('C5_EXECUTE') or die("Access Denied.");
Loader::model('user_attribute_text');
Loader::model('attribute/categories/collection');
class ProfileFilesController extends Controller {
var $helpers = array('html', 'form', 'date');
public function __construct() {
$html = Loader::helper('html');
parent::__construct();
$u = new User();
if (!$u->isRegistered()) {
$this->set('intro_msg', t('You must sign in order to access this page!'));
Loader::controller('/login');
$this->render('/login');
}
$this->set('ui', UserInfo::getByID($u->getUserID()));
$this->set('av', Loader::helper('concrete/avatar'));
}
public function on_start() {
$this->addHeaderItem(Loader::helper('html')->css('ccm.profile.css'));
}
}
?>
3. I created a second files.php, to add to single_pages/profile, consisting of some basic cut-and-pasted code from single_pages/profile/edit.php:
<?php defined('C5_EXECUTE') or die("Access Denied."); ?>
<div id="ccm-profile-wrapper">
<?php Loader::element('profile/sidebar', array('profile'=> $ui)); ?>
<div id="ccm-profile-body">
<h2>Filed</h2>
</div>
<div class="ccm-spacer"></div>
</div>
4. I added "Files" as a single page at the dashboard (Pages and Themes).
5. I checked it, mysite.com/profile/files, and the header ("<h2>Files</h2>") shows up!
That means it's working, right?