17488 Posts in 4473 Topics by 1978 members
| Go to End | Next > | |
| Author | Topic: | 1918 Views |
-
dismantling the forum

9 December 2008 at 12:08pm
I'm trying to use some of the features of the forum but not for a forum. I'm dismantling the forum module trying to understand what's happening. Here's my first queston on this thread. Thanks in advance.
pages of type ForumMemberProfile are chidren of what? Forum? ForumHolder?
-
Re: dismantling the forum

9 December 2008 at 8:37pm
ForumMemberProfile doesnt actually have children. It isnt even a page created in the CMS. Its just a 'holder' for the Member profile pages.
-
Re: dismantling the forum

10 December 2008 at 4:10am
Hi Willr,
Thanks for responding. What I am actually trying to understand is if ForumMemberProfile is a child of another page and not if it has children. I see these two methods in ForumMemberProfile class and could use a little clarification on them. ForumMemberProfile has a Forum parent? Why are we tricking sitetree?
/**
* This will trick SilverStripe into placing this page within the site
* tree
*/
function getParent() {
$siblingForum = Forum_Controller::getLastForumAccessed();
return $siblingForum->Parent;
}/**
* This will trick SilverStripe into placing this page within the site
* tree
*/
function getParentID() {
$siblingForum = Forum_Controller::getLastForumAccessed();
return $siblingForum->ParentID;
}Also, where in the code is it defined that pages ForumMemberProfile/show/ resolve? How is this working? Where is "show" being handled? Where does it determine to use ForumMemberProfile_show.ss template?
Thanks again
-
Re: dismantling the forum

10 December 2008 at 10:00am
show refers to the function show() in the controller. The Parent ID is so it keeps menu highlighted and shows breadcrumbs etc. It just tricks SSS
-
Re: dismantling the forum

10 December 2008 at 12:00pm
What show() function in what controller please. And how about the ForumMemberProfile_show template. Where is that assigned?
Thanks -
Re: dismantling the forum

10 December 2008 at 12:12pm
the show() function in the ForumMemberProfile.php. When you call a page via a url like
site.com/ForumMemberProfile/show
it looks for a Class 'ForumMemberProfile' (or the class of a page with the URL 'ForumMemberProfile' - eg if you create a ForumMemberProfile page in the CMS and give it a URL of 'members' then you get the same result doing site.com/members/show) then on that class it calls the function show(). SilverStripe automatically handles how this gets rendered into ForumMemberProfile_show.ss as it looks for templates in the form - Classname_function.ss
-
Re: dismantling the forum

10 December 2008 at 1:11pm
Hi Willr,
Thanks again.
I don't see a show() function in ForumMemberProfile.php. ?
Thanks.
-
Re: dismantling the forum

10 December 2008 at 1:37pm
LeftAndMain, ReportAdmin and ComplexTableField have show() functions. I'm guessing LeftAndMain is the one you want.
cms/code/LeftAndMain.php, ln 226.
| 1918 Views | ||
| Go to Top | Next > |


