941 Posts in 272 Topics by 292 members
Forum Module
SilverStripe Forums » Forum Module » [solved] Latest posts custom function
Discuss the Forum Module.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 869 Views |
-
[solved] Latest posts custom function

13 August 2009 at 12:35pm Last edited: 14 August 2009 7:09am
Hi, I want to include the latest forum posts on a page outside the forum.
this gets me the actual post data I need (title, content,create date):
public function LatestIdeas() {
return DataObject::get("Post","","ID desc","",5);
}
But I also want to include the Author name along with this....can anyone help with this??
-
Re: [solved] Latest posts custom function

13 August 2009 at 5:59pm
A post has a relationship with a member namely a author ID. So you can do $Author in the template gets you the Author object then you can do things like $Author.Nickname to get their nickname
-
Re: [solved] Latest posts custom function

14 August 2009 at 7:10am Last edited: 14 August 2009 7:10am
Thanks will.
It all seems so straightforward when someone else spells it out for you....
| 869 Views | ||
|
Page:
1
|
Go to Top |

