Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

dismantling the forum


Go to End


9 Posts   4444 Views

Avatar
g

Community Member, 22 Posts

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?

Avatar
Willr

Forum Moderator, 5523 Posts

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.

Avatar
g

Community Member, 22 Posts

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

Avatar
Willr

Forum Moderator, 5523 Posts

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

Avatar
g

Community Member, 22 Posts

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

Avatar
Willr

Forum Moderator, 5523 Posts

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

Avatar
g

Community Member, 22 Posts

10 December 2008 at 1:11pm

Hi Willr,

Thanks again.

I don't see a show() function in ForumMemberProfile.php. ?

Thanks.

Avatar
JGC

Community Member, 25 Posts

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.

Go to Top