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

20 July 2011 at 3:04am
Hi,
I'd like to add a sidebox to my blog that shows a few related posts. This sidebox would only be visible when you are viewing a single blog entry. I've figured out how to add the sidebox. What I need advice on is how to grab and display the related posts.
By related I am thinking this would look at the tags associated with the blog entry and then show titles and excerpts of the 3 most recent posts that contain 1 or more of the tags associated with the blog entry.
And suggestions or ideas would be great.
thank you!
-
Re: Related Posts

31 July 2011 at 1:14am
@biapar - Thanks for asking! No, I haven't figured this one out yet.
In another thread I saw a snippet of code that looks like this:
function LatestNews($num=5) {
return DataObject::get("ArticlePage", "Tags LIKE '%news%' ", "Date DESC", "", $num);
}...which seems along the lines of what I need. But I am not sure how I would modify this to grab the first tag or the other tags associated with the post the user is currently viewing.
If you have any suggestions, that would be great. Thanks!
| 768 Views | ||
|
Page:
1
|
Go to Top |

