Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » dismantling the forum

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

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

Page: 1 2
Go to End
Author Topic: 2194 Views
  • g
    Avatar
    Community Member
    22 Posts

    dismantling the forum Link to this post

    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?

  • Willr
    Avatar
    Forum Moderator
    5490 Posts

    Re: dismantling the forum Link to this post

    ForumMemberProfile doesnt actually have children. It isnt even a page created in the CMS. Its just a 'holder' for the Member profile pages.

  • g
    Avatar
    Community Member
    22 Posts

    Re: dismantling the forum Link to this post

    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

  • Willr
    Avatar
    Forum Moderator
    5490 Posts

    Re: dismantling the forum Link to this post

    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

  • g
    Avatar
    Community Member
    22 Posts

    Re: dismantling the forum Link to this post

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

  • Willr
    Avatar
    Forum Moderator
    5490 Posts

    Re: dismantling the forum Link to this post

    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

  • g
    Avatar
    Community Member
    22 Posts

    Re: dismantling the forum Link to this post

    Hi Willr,

    Thanks again.

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

    Thanks.

  • JGC
    Avatar
    Community Member
    25 Posts

    Re: dismantling the forum Link to this post

    LeftAndMain, ReportAdmin and ComplexTableField have show() functions. I'm guessing LeftAndMain is the one you want.

    cms/code/LeftAndMain.php, ln 226.

    2194 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.