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.

Archive

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

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

dismantling the forum


Go to End
Reply

9 Posts   2247 Views

Avatar
g

9 December 2008 at 12:08pm Community Member, 22 Posts

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

9 December 2008 at 8:37pm Forum Moderator, 5511 Posts

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

10 December 2008 at 4:10am Community Member, 22 Posts

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

10 December 2008 at 10:00am Forum Moderator, 5511 Posts

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

10 December 2008 at 12:00pm Community Member, 22 Posts

What show() function in what controller please. And how about the ForumMemberProfile_show template. Where is that assigned?
Thanks

Avatar
Willr

10 December 2008 at 12:12pm Forum Moderator, 5511 Posts

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

10 December 2008 at 1:11pm Community Member, 22 Posts

Hi Willr,

Thanks again.

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

Thanks.

Avatar
JGC

10 December 2008 at 1:37pm Community Member, 25 Posts

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