luyolo.mhlauli-nmmu.ac
-
7/4/2012 8:15:40 AM
RE:Lastest news from another site.
I managed to figure this out. I had to display news in a scrolling news webpart. So I cloned the scrolling text webpart since scrolling news webpart inherits from scrolling text webpart. In my cloned scrolling text webpart I set the SiteName field type to multiple site selector instead of site selector which will have sitenames separated by a semi colon ( ; ) . and in the code behind I add this line of code below this line of code .
repItems.WhereCondition = WhereCondition;
String whereadd = "' OR SiteName ='";
if ( SiteName.IndexOf(";") != -1 )
{ repItems.SiteName = "##ALL##" ; if( repItems.WhereCondition != "") { repItems.WhereCondition += " AND DocumentNodeID IN ( SELECT NodeID FROM View_CONTENT_news_Joined WHERE SiteName = '" + SiteName.ToString().Replace(";", whereadd) + "')"; } else { repItems.WhereCondition = "DocumentNodeID IN ( SELECT NodeID FROM View_CONTENT_news_Joined WHERE SiteName = '" + SiteName.ToString().Replace(";", whereadd) + "')"; } }
I then create a new scrolling news webpart which inherits from my the cloned scrolling text webpart. I now have a scrolling news webpart which selects news from multiple sites chosen using a multiple site selector
|