admin
-
4/5/2006 1:46:40 PM
Re: How to Show related articles?
Hi Kim,
Thank you for your post. Yes, this is possible and there are several ways how to show the related articles. If you would like to display only article documents that contain the selected keyword specified for the displayed article, you could use this:
1) Create a custom query cms.article.searchtext that will look like this: SELECT view_cms_tree_joined.*, view_cms_tree_joined.NodeName AS SearchResultName FROM view_cms_tree_joined INNER JOIN [CONTENT_Article] ON [CONTENT_Article].[ArticleID] = view_cms_tree_joined.foreignkeyvalue WHERE classname = 'CMS.Article' ##WHERE ##
2) Use the QueryRepeater control (like you do for the Latest News in the sample Corporate Site). Set the QueryName property to "cms.article.searchtext" and, in your codebehind, set dynamically the WhereCondition parameter like this:
QueryRepeater1.WhereCondition = "AND articletext LIKE N'%"+ searchedKeyword.Replace("'", "''") +"%'";
Please let me know if you need any help with that.
Best Regards,
|