Quantcast
Channel:
Viewing all articles
Browse latest Browse all 4235

Re: Create sidebars based on dataobjects

$
0
0

Cheers Mo - I'll have a look at that tut again - the problem I have is it chokes on the CurrentPage controller. telling me that it does not exist which made me think Oh hang on this old code. - section below:

<codeblock>
public function LinkingMode()
{
//Check that we have a controller to work with and that it is a StaffPage
if(Controller::CurrentPage() && Controller::CurrentPage()->ClassName == 'StaffPage')
{
//check that the action is 'show' and that we have a StaffMember to work with
if(Controller::CurrentPage()->getAction() == 'show' && $StaffMember = Controller::CurrentPage()->getStaffMember())
{
//If the current StaffMember is the same as this return 'current' class
return ($StaffMember->ID == $this->ID) ? 'current' : 'link';
}
}
}
</codeblock>


Posted to: Create sidebars based on dataobjects | Show Thread | Post Reply


Viewing all articles
Browse latest Browse all 4235

Trending Articles