1770 Posts in 495 Topics by 531 members
Blog Module
SilverStripe Forums » Blog Module » Link to post from comment...
Discuss the Blog Module.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1387 Views |
-
Link to post from comment...

7 December 2010 at 9:04pm
Hi,
How create link from comment to post?
Because I've create function that listing latest comments from blog...This is code:
function LatestComments() {
$member = Member::currentUser();
//if(!$member) return false;
//$comments = DataObject::get("PageComment", "AuthorID = '$member->ID'","Created DESC","",10);
$comments = DataObject::get("PageComment",null,"Created DESC","",10);
return $comments;
}Thanks
-
Re: Link to post from comment...

8 December 2010 at 11:34am
In the template you can simply call $Link to get a link to the specific comment just like you do with pages.
-
Re: Link to post from comment...

9 December 2010 at 2:47am
Thanks,
I tried. I wrote
<p class="commento"><a href="$Link" title="$Title.XML" class="$LinkingMode">$Comment.XML</a></p>
but link don't works becasue I've as result:
http://red-web-projects/PhPSites/xyz/#PageComment_6
Why?
-
Re: Link to post from comment...

22 December 2010 at 10:18am
Hi biapar,
$Parent.Link() should do it.
chao
Carlos
| 1387 Views | ||
|
Page:
1
|
Go to Top |


