21288 Posts in 5733 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 658 Views |
-
differen data for a page based on login id

23 March 2010 at 5:55am
Hello,
This may seem a bit daft at first but I am moving into new territory with SilverStripe.
The scenario is I want to create a client area that is accessed via a login. I have seen how to do this on ssbits.
Once the client has logged in, I would like them to have access to about 5 pages. Basically its an internal quotation system for that client. I would like this to be 5 pages on the Admin side on the Site Tree menu.
However there could be 100 clients and do not want to create 500 pages. Rather have 5 pages that change the displayed data.
It is a database read based on login id.
Are there any recipes / tutorials / examples out there that show how to retrieve data based on login id?
Cheers
Chris -
Re: differen data for a page based on login id

24 March 2010 at 1:05am
Hi Chris
What you would need to do is to create a custom function in each pages controller to return the correct data, so something like this (not tested just off the top of my head):
function getMemberContent(){
if($Member = $Member::currentMember()){
$Content = //Do something based on $Member->ID
return $Content;
}
}Then in your template you can use $MemberContent
Is that the sort of thing you were thinking?
Aram
-
Re: differen data for a page based on login id

25 March 2010 at 12:02am
Hi Aram,
thank you that is ideal.
Cheers
Chris
| 658 Views | ||
|
Page:
1
|
Go to Top |


