Pages

Thursday, September 22, 2011

Hide SharePoint 2010 ribbon for Anonymous user

http://spribbonvisibility.codeplex.com/

Content Query Web Part with support for paging

  1. Create new folder named "AR" under "/Style Library/XSL Style Sheets/" , Using Notepad, create a new file, past the following content to it, save it as "NewsItemPaging.xsl"

    <?xml version="1.0" encoding="utf-8" ?>
    <xsl:stylesheet
      version="1.0"
      exclude-result-prefixes="x d xsl msxsl cmswrt"
      xmlns:x="http://www.w3.org/2001/XMLSchema"
      xmlns:d="http://schemas.microsoft.com/sharepoint/dsp"
      xmlns:cmswrt="http://schemas.microsoft.com/WebParts/v3/Publishing/runtime"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt"
      xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime">
        <xsl:param name="ItemsHaveStreams">
        <xsl:value-of select="'False'" />
      </xsl:param>
        <xsl:variable name="OnClickTargetAttribute" select="string('javascript:this.target=&quot;_blank&quot;')" />
        <xsl:variable name="ImageWidth" />
        <xsl:variable name="ImageHeight" />
        <xsl:template name="Default" match="*" mode="itemstyle">
           
            <xsl:variable name="SafeLinkUrl">
          <xsl:call-template name="OuterTemplate.GetSafeLink">
            <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
          </xsl:call-template>
        </xsl:variable>
            <xsl:variable name="SafeImageUrl">
          <xsl:call-template name="OuterTemplate.GetSafeStaticUrl">
            <xsl:with-param name="UrlColumnName" select="'ImageUrl'"/>
          </xsl:call-template>
        </xsl:variable>
            <xsl:variable name="DisplayTitle">
          <xsl:call-template name="OuterTemplate.GetTitle">
            <xsl:with-param name="Title" select="@Title"/>
            <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
          </xsl:call-template>
        </xsl:variable>
            <div class="item">
                <xsl:if test="string-length($SafeImageUrl) != 0">
                    <div class="image-area-left">
                        <a href="{$SafeLinkUrl}">
                            <xsl:if test="$ItemsHaveStreams = 'True'">
                                <xsl:attribute name="onclick">
                    <xsl:value-of select="@OnClickForWebRendering"/>
                  </xsl:attribute>
                            </xsl:if>
                            <xsl:if test="$ItemsHaveStreams != 'True' and @OpenInNewWindow = 'True'">
                                <xsl:attribute name="onclick">
                    <xsl:value-of disable-output-escaping="yes" select="$OnClickTargetAttribute"/>
                  </xsl:attribute>
                            </xsl:if>
                            <img class="image" src="{$SafeImageUrl}" title="{@ImageUrlAltText}">
                                <xsl:if test="$ImageWidth != ''">
                                    <xsl:attribute name="width">
                      <xsl:value-of select="$ImageWidth" />
                    </xsl:attribute>
                                </xsl:if>
                                <xsl:if test="$ImageHeight != ''">
                                    <xsl:attribute name="height">
                      <xsl:value-of select="$ImageHeight" />
                    </xsl:attribute>
                                </xsl:if>
                            </img>
                        </a>
                    </div>
                </xsl:if>
                <div class="link-item">
                    <xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>
                    <a href="{$SafeLinkUrl}" title="{@LinkToolTip}">
                        <xsl:if test="$ItemsHaveStreams = 'True'">
                            <xsl:attribute name="onclick">
                  <xsl:value-of select="@OnClickForWebRendering"/>
                </xsl:attribute>
                        </xsl:if>
                        <xsl:if test="$ItemsHaveStreams != 'True' and @OpenInNewWindow = 'True'">
                            <xsl:attribute name="onclick">
                  <xsl:value-of disable-output-escaping="yes" select="$OnClickTargetAttribute"/>
                </xsl:attribute>
                        </xsl:if>
                        <xsl:value-of select="$DisplayTitle"/>
                    </a>
                    <div class="description">
                        <xsl:value-of select="@Description" />
                    </div>
                </div>
            </div>
        </xsl:template>
        <xsl:template name="PagingControls">
            <xsl:param name="Page" />
            <xsl:param name="NumPages" />
            <xsl:if test="$Page = 1">
                <xsl:text disable-output-escaping="yes"><![CDATA[<div class="pagerSC">]]></xsl:text>
                <xsl:if test="$PageNumber &gt; 1">
               
                    <xsl:variable name="PreviousPageNo" select="$PageNumber - 1"/>
                   
                    <a href="?{$PagingParameterName}={$PreviousPageNo}">
                        <xsl:text disable-output-escaping="yes"><![CDATA[&laquo;]]></xsl:text>
                        السابق
            </a>
                    <xsl:text disable-output-escaping="yes"><![CDATA[&nbsp;]]></xsl:text>
                </xsl:if>
            </xsl:if>
            <xsl:choose>
                <xsl:when test="$Page = $PageNumber">
                    <span>
                        <xsl:value-of select="$Page"/>
                    </span>
                </xsl:when>
                <xsl:otherwise>
                    <a href="?{$PagingParameterName}={$Page}">
                        <xsl:value-of select="$Page"/>
                    </a>
                </xsl:otherwise>
            </xsl:choose>
            <xsl:text disable-output-escaping="yes"><![CDATA[&nbsp;]]></xsl:text>
            <xsl:if test="$Page &lt; $NumPages">
                <xsl:call-template name="PagingControls">
                    <xsl:with-param name="Page" select="$Page + 1"/>
                    <xsl:with-param name="NumPages" select="$NumPages" />
                </xsl:call-template>
            </xsl:if>
            <xsl:if test="$Page = $NumPages">
                <xsl:if test="$PageNumber &lt; $NumPages">
                    <xsl:variable name="NextPageNo" select="$PageNumber + 1"/>
                    <a class="nextprev" href="?{$PagingParameterName}={$NextPageNo}">
              التالي
              <xsl:text disable-output-escaping="yes"><![CDATA[&raquo;]]></xsl:text>
            </a>
           
                </xsl:if>
                <xsl:text disable-output-escaping="yes"><![CDATA[<div style="clear: left;"></div></div>]]></xsl:text>
            </xsl:if>
        </xsl:template>
       
           
        <xsl:template name="ImageRight" match="Row[@Style='ImageRight']" mode="itemstyle">
        <xsl:param name="CurPos" />
            <xsl:variable name="SafeLinkUrl">
          <xsl:call-template name="OuterTemplate.GetSafeLink">
            <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
          </xsl:call-template>
        </xsl:variable>
            <xsl:variable name="SafeImageUrl">
          <xsl:call-template name="OuterTemplate.GetSafeStaticUrl">
            <xsl:with-param name="UrlColumnName" select="'ImageUrl'"/>
          </xsl:call-template>
        </xsl:variable>
            <xsl:variable name="DisplayTitle">
          <xsl:call-template name="OuterTemplate.GetTitle">
            <xsl:with-param name="Title" select="@Title"/>
            <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
          </xsl:call-template>
        </xsl:variable>

            <div class="item" style="padding-right:0px;padding-bottom:0px">
                <xsl:if test="string-length($SafeImageUrl) != 0">
                    <div class="image-area-left">
                        <a href="{$SafeLinkUrl}">
                            <xsl:if test="$ItemsHaveStreams = 'True'">
                                <xsl:attribute name="onclick">
                    <xsl:value-of select="@OnClickForWebRendering"/>
                  </xsl:attribute>
                            </xsl:if>
                            <xsl:if test="$ItemsHaveStreams != 'True' and @OpenInNewWindow = 'True'">
                                <xsl:attribute name="onclick">
                    <xsl:value-of disable-output-escaping="yes" select="$OnClickTargetAttribute"/>
                  </xsl:attribute>
                            </xsl:if>
                            <img width="200px" height="150px" style="margin-top:10px;margin-right:10px" class="image" src="{$SafeImageUrl}" title="{@ImageUrlAltText}">
                                <xsl:if test="$ImageWidth != ''">
                                    <xsl:attribute name="width">
                      <xsl:value-of select="$ImageWidth" />
                    </xsl:attribute>
                                </xsl:if>
                                <xsl:if test="$ImageHeight != ''">
                                    <xsl:attribute name="height">
                      <xsl:value-of select="$ImageHeight" />
                    </xsl:attribute>
                                </xsl:if>
                            </img>
                        </a>
                    </div>
                </xsl:if>
                <div style="padding-right:20px;padding-left:20px;" class="link-item">
                    <xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>
                    <a style="font-family:Arial,Helvetica,sans-serif;color:#bf040b;font-size:18px;font-weight:bold" href="{$SafeLinkUrl}" title="{@LinkToolTip}">
                        <xsl:if test="$ItemsHaveStreams = 'True'">
                            <xsl:attribute name="onclick">
                  <xsl:value-of select="@OnClickForWebRendering"/>
                </xsl:attribute>
                        </xsl:if>
                        <xsl:if test="$ItemsHaveStreams != 'True' and @OpenInNewWindow = 'True'">
                            <xsl:attribute name="onclick">
                  <xsl:value-of disable-output-escaping="yes" select="$OnClickTargetAttribute"/>
                </xsl:attribute>
                        </xsl:if>
                        <xsl:value-of select="$DisplayTitle"/>
                    </a>
                    </div>
                    <div style="padding-right:20px;padding-left:20px;color:maroon;font-size:small;line-height:30px;font-family: Tahoma, Arial, Helvetica, Sans-serif;">
                    <xsl:value-of select="ddwrt:FormatDateTime(string(@ArticleDate) ,3073 ,'dd MMMMM yyyy')"/>
                </div>
                <div style="padding-right:20px;padding-left:20px;list-style:none !important;line-height:20px;color:#576170;text-align:justify" class="description">
                    <xsl:value-of disable-output-escaping="yes" select="@Description" />

                    <a style="float:left;color:#00889a;font-weight:bold;padding-bottom:10px" href="{$SafeLinkUrl}">مزيـد</a>
                   
                </div>
               
                            <xsl:if test="$CurPos = 1 and $PageSize &gt; 0">
                <xsl:variable name="NumPages" select="ceiling($TotalRecords div $PageSize)"/>
                <xsl:if test="$NumPages &gt; 1">
                    <xsl:call-template name="PagingControls">
                        <xsl:with-param name="Page" select="1" />
                        <xsl:with-param name="NumPages" select="$NumPages" />
                    </xsl:call-template>
                </xsl:if>
            </xsl:if>

            </div>
        </xsl:template>
       
        <xsl:template name="HiddenSlots" match="Row[@Style='HiddenSlots']" mode="itemstyle">
            <div class="SipAddress">
                <xsl:value-of select="@SipAddress" />
            </div>
            <div class="LinkToolTip">
                <xsl:value-of select="@LinkToolTip" />
            </div>
            <div class="OpenInNewWindow">
                <xsl:value-of select="@OpenInNewWindow" />
            </div>
            <div class="OnClickForWebRendering">
                <xsl:value-of select="@OnClickForWebRendering" />
            </div>
        </xsl:template>
    </xsl:stylesheet>

  2.  Using Notepad, create a new file, past the following content to it, save it as "NewsMainPaging.xsl" and upload it to "/Style Library/XSL Style Sheets/AR"

    <xsl:stylesheet
        version="1.0"
        exclude-result-prefixes="x xsl cmswrt cbq"
        xmlns:x="http://www.w3.org/2001/XMLSchema"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:cmswrt="http://schemas.microsoft.com/WebPart/v3/Publishing/runtime"
        xmlns:cbq="urn:schemas-microsoft-com:ContentByQueryWebPart">
      <xsl:output method="xml" indent="no" media-type="text/html" omit-xml-declaration="yes"/>
      <xsl:param name="cbq_isgrouping" />
      <xsl:param name="cbq_columnwidth" />
      <xsl:param name="Group" />
      <xsl:param name="GroupType" />
      <xsl:param name="cbq_iseditmode" />
      <xsl:param name="cbq_viewemptytext" />
      <xsl:param name="cbq_errortext" />
      <xsl:param name="SiteId" />
      <xsl:param name="WebUrl" />
      <xsl:param name="PageId" />
      <xsl:param name="WebPartId" />
      <xsl:param name="FeedPageUrl" />
      <xsl:param name="FeedEnabled" />
      <xsl:param name="SiteUrl" />
      <xsl:param name="BlankTitle" />
      <xsl:param name="BlankGroup" />
      <xsl:param name="UseCopyUtil" />
      <xsl:param name="DataColumnTypes" />
      <xsl:param name="ClientId" />
      <xsl:param name="Source" />
      <xsl:param name="RootSiteRef" />
      <xsl:param name="CBQPageUrl" />
      <xsl:param name="CBQPageUrlQueryStringForFilters" />
      <xsl:param name="PageSize" />
      <xsl:param name="PagingParameterName" />
      <xsl:param name="TotalRecords" />
      <xsl:param name="PageNumber" />
      <xsl:param name="WebPartTitle" />
      <xsl:param name="WebPartDescription" />
      <xsl:param name="WebPartTitleUrl" />
      <xsl:param name="Locale" />
      <xsl:param name="GroupStyle" />
      <xsl:param name="ItemStyle" />
      <xsl:variable name="BeginList" select="string('&lt;ul class=&quot;dfwp-list&quot; style=&quot;list-style-image:none;list-style-type:none;padding-right:0;&quot; &gt;')" />
      <xsl:variable name="EndList" select="string('&lt;/ul&gt;')" />
      <xsl:variable name="BeginListItem" select="string('&lt;li class=&quot;dfwp-item&quot; style=&quot;margin:0px&quot; &gt;')" />
      <xsl:variable name="EndListItem" select="string('&lt;/li&gt;')" />
      <xsl:template match="/">
        <xsl:call-template name="OuterTemplate" />
      </xsl:template>
      <xsl:template name="OuterTemplate">
        <xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row" />
        <xsl:variable name="RowCount" select="count($Rows)" />
        <xsl:variable name="IsEmpty" select="$RowCount = 0" />
        <div id="{concat('cbqwp', $ClientId)}" class="cbq-layout-main">
          <xsl:if test="$cbq_iseditmode = 'True' and string-length($cbq_errortext) != 0">
            <div class="wp-content description">
              <xsl:value-of disable-output-escaping="yes" select="$cbq_errortext" />
            </div>
          </xsl:if>
          <xsl:choose>
            <xsl:when test="$IsEmpty">
              <xsl:call-template name="OuterTemplate.Empty" >
                <xsl:with-param name="EditMode" select="$cbq_iseditmode" />
              </xsl:call-template>
            </xsl:when>
            <xsl:otherwise>
              <xsl:call-template name="OuterTemplate.Body">
                <xsl:with-param name="Rows" select="$Rows" />
                <xsl:with-param name="FirstRow" select="1" />
                <xsl:with-param name="LastRow" select="$RowCount" />
              </xsl:call-template>
            </xsl:otherwise>
          </xsl:choose>
        </div>
        <xsl:if test="$FeedEnabled = 'True' and $PageId != ''">
          <div class="cqfeed">
            <xsl:variable name="FeedUrl1" select="concat($SiteUrl,$FeedPageUrl,'xsl=1&amp;web=',$WebUrl,'&amp;page=',$PageId,'&amp;wp=',$WebPartId,'&amp;pageurl=',$CBQPageUrl,$CBQPageUrlQueryStringForFilters)" />
            <a href="{cmswrt:RegisterFeedUrl( $FeedUrl1, 'application/rss+xml')}">
              <img src="\_layouts\images\rss.gif" border="0" alt="{cmswrt:GetPublishingResource('CbqRssAlt')}"/>
            </a>
          </div>
        </xsl:if>
      </xsl:template>
      <xsl:template name="OuterTemplate.Empty">
        <xsl:param name="EditMode" />
        <xsl:if test="$EditMode = 'True' and string-length($cbq_errortext) = 0">
          <div class="wp-content description">
            <xsl:value-of disable-output-escaping="yes" select="$cbq_viewemptytext" />
          </div>
        </xsl:if>
      </xsl:template>
      <xsl:template name="OuterTemplate.Body">
        <xsl:param name="Rows" />
        <xsl:param name="FirstRow" />
        <xsl:param name="LastRow" />
        <xsl:variable name="BeginColumn1" select="string('&lt;ul class=&quot;dfwp-column dfwp-list&quot; style=&quot;list-style-image:none;list-style-type:none;padding-right:0;&quot;')" />
        <xsl:variable name="BeginColumn2" select="string('&gt;')" />
        <xsl:variable name="BeginColumn" select="concat($BeginColumn1, $BeginColumn2)" />
        <xsl:variable name="EndColumn" select="string('&lt;/ul&gt;')" />
        <xsl:for-each select="$Rows">
          <xsl:variable name="CurPosition" select="position()" />
          <xsl:if test="($CurPosition &gt;= $FirstRow and $CurPosition &lt;= $LastRow)">
            <xsl:variable name="StartNewGroup" select="@__begingroup = 'True'" />
            <xsl:variable name="StartNewColumn" select="@__begincolumn = 'True'" />
            <xsl:choose>
              <xsl:when test="$cbq_isgrouping != 'True'">
                <xsl:if test="$CurPosition = $FirstRow">
                  <xsl:value-of disable-output-escaping="yes" select="$BeginColumn" />
                </xsl:if>
              </xsl:when>
              <xsl:when test="$StartNewGroup and $StartNewColumn">
                <xsl:choose>
                  <xsl:when test="$CurPosition = $FirstRow">
                    <xsl:value-of disable-output-escaping="yes" select="$BeginColumn" />
                    <xsl:call-template name="OuterTemplate.CallHeaderTemplate"/>
                  </xsl:when>
                  <xsl:otherwise>
                    <xsl:call-template name="OuterTemplate.CallFooterTemplate"/>
                    <xsl:value-of disable-output-escaping="yes" select="concat($EndColumn, $BeginColumn)" />
                    <xsl:call-template name="OuterTemplate.CallHeaderTemplate"/>
                  </xsl:otherwise>
                </xsl:choose>
              </xsl:when>
              <xsl:when test="$StartNewGroup">
                <xsl:call-template name="OuterTemplate.CallFooterTemplate"/>
                <xsl:call-template name="OuterTemplate.CallHeaderTemplate"/>
              </xsl:when>
              <xsl:when test="$StartNewColumn">
                <xsl:choose>
                  <xsl:when test="$CurPosition = $FirstRow">
                    <xsl:value-of disable-output-escaping="yes" select="$BeginColumn" />
                  </xsl:when>
                  <xsl:otherwise>
                    <xsl:value-of disable-output-escaping="yes" select="concat($EndColumn, $BeginColumn)" />
                  </xsl:otherwise>
                </xsl:choose>
              </xsl:when>
              <xsl:otherwise>
              </xsl:otherwise>
            </xsl:choose>
            <xsl:call-template name="OuterTemplate.CallItemTemplate">
              <xsl:with-param name="CurPosition" select="$CurPosition" />
            </xsl:call-template>
            <xsl:if test="$CurPosition = $LastRow">
              <xsl:if test="$cbq_isgrouping = 'True'">
                <xsl:call-template name="OuterTemplate.CallFooterTemplate"/>
              </xsl:if>
              <xsl:value-of disable-output-escaping="yes" select="$EndColumn" />
            </xsl:if>
          </xsl:if>
        </xsl:for-each>
      </xsl:template>
      <xsl:template name="OuterTemplate.CallHeaderTemplate">
        <xsl:value-of disable-output-escaping="yes" select="$BeginListItem" />
        <xsl:apply-templates select="." mode="header">
        </xsl:apply-templates>
        <xsl:value-of disable-output-escaping="yes" select="$BeginList" />
      </xsl:template>
      <xsl:template name="OuterTemplate.CallItemTemplate">
        <xsl:param name="CurPosition" />
        <xsl:value-of disable-output-escaping="yes" select="$BeginListItem" />
        <xsl:choose>
          <xsl:when test="@Style='NewsRollUpItem'">
            <xsl:apply-templates select="." mode="itemstyle">
              <xsl:with-param name="EditMode" select="$cbq_iseditmode" />
            </xsl:apply-templates>
          </xsl:when>
          <xsl:when test="@Style='NewsBigItem'">
            <xsl:apply-templates select="." mode="itemstyle">
              <xsl:with-param name="CurPos" select="$CurPosition" />
            </xsl:apply-templates>
          </xsl:when>
          <xsl:when test="@Style='NewsCategoryItem'">
            <xsl:apply-templates select="." mode="itemstyle">
              <xsl:with-param name="CurPos" select="$CurPosition" />
            </xsl:apply-templates>
          </xsl:when>
          <xsl:otherwise>
            <xsl:apply-templates select="." mode="itemstyle">
              <xsl:with-param name="CurPos" select="$CurPosition" />
            </xsl:apply-templates>
          </xsl:otherwise>
        </xsl:choose>
        <xsl:value-of disable-output-escaping="yes" select="$EndListItem" />
      </xsl:template>
      <xsl:template name="OuterTemplate.CallFooterTemplate">
        <xsl:value-of disable-output-escaping="yes" select="$EndList" />
        <xsl:value-of disable-output-escaping="yes" select="$EndListItem" />
      </xsl:template>
      <xsl:template name="OuterTemplate.GetSafeLink">
        <xsl:param name="UrlColumnName"/>
        <xsl:if test="$UseCopyUtil = 'True'">
          <xsl:value-of select="concat($RootSiteRef,'/_layouts/CopyUtil.aspx?Use=id&amp;Action=dispform&amp;ItemId=',@ID,'&amp;ListId=',@ListId,'&amp;WebId=',@WebId,'&amp;SiteId=',$SiteId,'&amp;Source=',$Source)"/>
        </xsl:if>
        <xsl:if test="$UseCopyUtil != 'True'">
          <xsl:call-template name="OuterTemplate.GetSafeStaticUrl">
            <xsl:with-param name="UrlColumnName" select="$UrlColumnName"/>
          </xsl:call-template>
        </xsl:if>
      </xsl:template>
      <xsl:template name="OuterTemplate.GetTitle">
        <xsl:param name="Title"/>
        <xsl:param name="UrlColumnName"/>
        <xsl:param name="UseFileName" select="0"/>
        <xsl:choose>
          <xsl:when test="string-length($Title) != 0 and $UseFileName = 0">
            <xsl:value-of select="$Title" />
          </xsl:when>
          <xsl:when test="$UseCopyUtil = 'True' and $UseFileName = 0">
            <xsl:value-of select="$BlankTitle" />
          </xsl:when>
          <xsl:otherwise>
            <xsl:variable name="FileNameWithExtension">
              <xsl:call-template name="OuterTemplate.GetPageNameFromUrl">
                <xsl:with-param name="UrlColumnName" select="$UrlColumnName" />
              </xsl:call-template>
            </xsl:variable>
            <xsl:choose>
              <xsl:when test="$UseFileName = 1">
                <xsl:call-template name="OuterTemplate.GetFileNameWithoutExtension">
                  <xsl:with-param name="input" select="$FileNameWithExtension" />
                </xsl:call-template>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="$FileNameWithExtension" />
              </xsl:otherwise>
            </xsl:choose>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:template>
      <xsl:template name="OuterTemplate.FormatColumnIntoUrl">
        <xsl:param name="UrlColumnName"/>
        <xsl:variable name="Value" select="@*[name()=$UrlColumnName]"/>
        <xsl:if test="contains($DataColumnTypes,concat(';',$UrlColumnName,',URL;'))">
          <xsl:call-template name="OuterTemplate.FormatValueIntoUrl">
            <xsl:with-param name="Value" select="$Value"/>
          </xsl:call-template>
        </xsl:if>
        <xsl:if test="not(contains($DataColumnTypes,concat(';',$UrlColumnName,',URL;')))">
          <xsl:value-of select="$Value"/>
        </xsl:if>
      </xsl:template>
      <xsl:template name="OuterTemplate.FormatValueIntoUrl">
        <xsl:param name="Value"/>
        <xsl:if test="not(contains($Value,', '))">
          <xsl:value-of select="$Value"/>
        </xsl:if>
        <xsl:if test="contains($Value,', ')">
          <xsl:call-template name="OuterTemplate.Replace">
            <xsl:with-param name="Value" select="substring-before($Value,', ')"/>
            <xsl:with-param name="Search" select="',,'"/>
            <xsl:with-param name="Replace" select="','"/>
          </xsl:call-template>
        </xsl:if>
      </xsl:template>
      <xsl:template name="OuterTemplate.Replace">
        <xsl:param name="Value"/>
        <xsl:param name="Search"/>
        <xsl:param name="Replace"/>
        <xsl:if test="contains($Value,$Search)">
          <xsl:value-of select="concat(substring-before($Value,$Search),$Replace)"/>
          <xsl:call-template name="OuterTemplate.Replace">
            <xsl:with-param name="Value" select="substring-after($Value,$Search)"/>
            <xsl:with-param name="Search" select="$Search"/>
            <xsl:with-param name="Replace" select="$Replace"/>
          </xsl:call-template>
        </xsl:if>
        <xsl:if test="not(contains($Value,$Search))">
          <xsl:value-of select="$Value"/>
        </xsl:if>
      </xsl:template>
      <xsl:template name="OuterTemplate.GetSafeStaticUrl">
        <xsl:param name="UrlColumnName"/>
        <xsl:variable name="Url">
          <xsl:call-template name="OuterTemplate.FormatColumnIntoUrl">
            <xsl:with-param name="UrlColumnName" select="$UrlColumnName"/>
          </xsl:call-template>
        </xsl:variable>
        <xsl:value-of select="cmswrt:EnsureIsAllowedProtocol($Url)"/>
      </xsl:template>
      <xsl:template name="OuterTemplate.GetColumnDataForUnescapedOutput">
        <xsl:param name="Name"/>
        <xsl:param name="MustBeOfType"/>
        <xsl:if test="contains($DataColumnTypes,concat(';',$Name,',',$MustBeOfType,';'))">
          <xsl:value-of select="@*[name()=$Name]"/>
        </xsl:if>
      </xsl:template>
      <xsl:template name="OuterTemplate.GetPageNameFromUrl">
        <xsl:param name="UrlColumnName"/>
        <xsl:variable name="Url">
          <xsl:call-template name="OuterTemplate.FormatColumnIntoUrl">
            <xsl:with-param name="UrlColumnName" select="$UrlColumnName"/>
          </xsl:call-template>
        </xsl:variable>
        <xsl:call-template name="OuterTemplate.GetPageNameFromUrlRecursive">
          <xsl:with-param name="Url" select="$Url"/>
        </xsl:call-template>
      </xsl:template>
      <xsl:template name="OuterTemplate.GetPageNameFromUrlRecursive">
        <xsl:param name="Url"/>
        <xsl:choose>
          <xsl:when test="contains($Url,'/') and substring($Url,string-length($Url)) != '/'">
            <xsl:call-template name="OuterTemplate.GetPageNameFromUrlRecursive">
              <xsl:with-param name="Url" select="substring-after($Url,'/')"/>
            </xsl:call-template>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="$Url"/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:template>
      <xsl:template name="OuterTemplate.GetGroupName">
        <xsl:param name="GroupName"/>
        <xsl:param name="GroupType"/>
        <xsl:choose>
          <xsl:when test="string-length(normalize-space($GroupName)) = 0">
            <xsl:value-of select="$BlankGroup"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:choose>
              <xsl:when test="$GroupType='URL'">
                <xsl:variable name="Url">
                  <xsl:call-template name="OuterTemplate.FormatValueIntoUrl">
                    <xsl:with-param name="Value" select="$GroupName"/>
                  </xsl:call-template>
                </xsl:variable>
                <xsl:call-template name="OuterTemplate.GetPageNameFromUrlRecursive">
                  <xsl:with-param name="Url" select="$Url"/>
                </xsl:call-template>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="$GroupName" />
              </xsl:otherwise>
            </xsl:choose>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:template>
      <xsl:template name="OuterTemplate.CallPresenceStatusIconTemplate">
        <xsl:if test="string-length(@SipAddress) != 0">
          <span class="presence-status-icon">
            <img src="/_layouts/images/imnhdr.gif" onload="IMNRC('{@SipAddress}')" ShowOfflinePawn="1" alt="" id="{concat('MWP_pawn_',$ClientId,'_',@ID,'type=sip')}"/>
          </span>
        </xsl:if>
      </xsl:template>
      <xsl:template name="OuterTemplate.GetFileNameWithoutExtension">
        <xsl:param name="input"/>
        <xsl:variable name="extension">
          <xsl:value-of select="substring-after($input, '.')"/>
        </xsl:variable>
        <xsl:choose>
          <xsl:when test="contains($extension, '.')">
            <xsl:variable name="afterextension">
              <xsl:call-template name="OuterTemplate.GetFileNameWithoutExtension">
                <xsl:with-param name="input" select="$extension"/>
              </xsl:call-template>
            </xsl:variable>
            <xsl:value-of select="concat(substring-before($input, '.'), $afterextension)"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:choose>
              <xsl:when test="contains($input, '.')">
                <xsl:value-of select="substring-before($input, '.')"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="$input"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:template>
    </xsl:stylesheet>

  3. Using Notepad, create a new file, past the following content to it, save it as "Arabic News Rotator.webpart" and upload it to your "webpart gallery:

    <xsl:stylesheet
        version="1.0"
        exclude-result-prefixes="x xsl cmswrt cbq"
        xmlns:x="http://www.w3.org/2001/XMLSchema"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:cmswrt="http://schemas.microsoft.com/WebPart/v3/Publishing/runtime"
        xmlns:cbq="urn:schemas-microsoft-com:ContentByQueryWebPart">
      <xsl:output method="xml" indent="no" media-type="text/html" omit-xml-declaration="yes"/>
      <xsl:param name="cbq_isgrouping" />
      <xsl:param name="cbq_columnwidth" />
      <xsl:param name="Group" />
      <xsl:param name="GroupType" />
      <xsl:param name="cbq_iseditmode" />
      <xsl:param name="cbq_viewemptytext" />
      <xsl:param name="cbq_errortext" />
      <xsl:param name="SiteId" />
      <xsl:param name="WebUrl" />
      <xsl:param name="PageId" />
      <xsl:param name="WebPartId" />
      <xsl:param name="FeedPageUrl" />
      <xsl:param name="FeedEnabled" />
      <xsl:param name="SiteUrl" />
      <xsl:param name="BlankTitle" />
      <xsl:param name="BlankGroup" />
      <xsl:param name="UseCopyUtil" />
      <xsl:param name="DataColumnTypes" />
      <xsl:param name="ClientId" />
      <xsl:param name="Source" />
      <xsl:param name="RootSiteRef" />
      <xsl:param name="CBQPageUrl" />
      <xsl:param name="CBQPageUrlQueryStringForFilters" />
      <xsl:param name="PageSize" />
      <xsl:param name="PagingParameterName" />
      <xsl:param name="TotalRecords" />
      <xsl:param name="PageNumber" />
      <xsl:param name="WebPartTitle" />
      <xsl:param name="WebPartDescription" />
      <xsl:param name="WebPartTitleUrl" />
      <xsl:param name="Locale" />
      <xsl:param name="GroupStyle" />
      <xsl:param name="ItemStyle" />
      <xsl:variable name="BeginList" select="string('&lt;ul class=&quot;dfwp-list&quot; style=&quot;list-style-image:none;list-style-type:none;padding-right:0;&quot; &gt;')" />
      <xsl:variable name="EndList" select="string('&lt;/ul&gt;')" />
      <xsl:variable name="BeginListItem" select="string('&lt;li class=&quot;dfwp-item&quot; style=&quot;margin:0px&quot; &gt;')" />
      <xsl:variable name="EndListItem" select="string('&lt;/li&gt;')" />
      <xsl:template match="/">
        <xsl:call-template name="OuterTemplate" />
      </xsl:template>
      <xsl:template name="OuterTemplate">
        <xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row" />
        <xsl:variable name="RowCount" select="count($Rows)" />
        <xsl:variable name="IsEmpty" select="$RowCount = 0" />
        <div id="{concat('cbqwp', $ClientId)}" class="cbq-layout-main">
          <xsl:if test="$cbq_iseditmode = 'True' and string-length($cbq_errortext) != 0">
            <div class="wp-content description">
              <xsl:value-of disable-output-escaping="yes" select="$cbq_errortext" />
            </div>
          </xsl:if>
          <xsl:choose>
            <xsl:when test="$IsEmpty">
              <xsl:call-template name="OuterTemplate.Empty" >
                <xsl:with-param name="EditMode" select="$cbq_iseditmode" />
              </xsl:call-template>
            </xsl:when>
            <xsl:otherwise>
              <xsl:call-template name="OuterTemplate.Body">
                <xsl:with-param name="Rows" select="$Rows" />
                <xsl:with-param name="FirstRow" select="1" />
                <xsl:with-param name="LastRow" select="$RowCount" />
              </xsl:call-template>
            </xsl:otherwise>
          </xsl:choose>
        </div>
        <xsl:if test="$FeedEnabled = 'True' and $PageId != ''">
          <div class="cqfeed">
            <xsl:variable name="FeedUrl1" select="concat($SiteUrl,$FeedPageUrl,'xsl=1&amp;web=',$WebUrl,'&amp;page=',$PageId,'&amp;wp=',$WebPartId,'&amp;pageurl=',$CBQPageUrl,$CBQPageUrlQueryStringForFilters)" />
            <a href="{cmswrt:RegisterFeedUrl( $FeedUrl1, 'application/rss+xml')}">
              <img src="\_layouts\images\rss.gif" border="0" alt="{cmswrt:GetPublishingResource('CbqRssAlt')}"/>
            </a>
          </div>
        </xsl:if>
      </xsl:template>
      <xsl:template name="OuterTemplate.Empty">
        <xsl:param name="EditMode" />
        <xsl:if test="$EditMode = 'True' and string-length($cbq_errortext) = 0">
          <div class="wp-content description">
            <xsl:value-of disable-output-escaping="yes" select="$cbq_viewemptytext" />
          </div>
        </xsl:if>
      </xsl:template>
      <xsl:template name="OuterTemplate.Body">
        <xsl:param name="Rows" />
        <xsl:param name="FirstRow" />
        <xsl:param name="LastRow" />
        <xsl:variable name="BeginColumn1" select="string('&lt;ul class=&quot;dfwp-column dfwp-list&quot; style=&quot;list-style-image:none;list-style-type:none;padding-right:0;&quot;')" />
        <xsl:variable name="BeginColumn2" select="string('&gt;')" />
        <xsl:variable name="BeginColumn" select="concat($BeginColumn1, $BeginColumn2)" />
        <xsl:variable name="EndColumn" select="string('&lt;/ul&gt;')" />
        <xsl:for-each select="$Rows">
          <xsl:variable name="CurPosition" select="position()" />
          <xsl:if test="($CurPosition &gt;= $FirstRow and $CurPosition &lt;= $LastRow)">
            <xsl:variable name="StartNewGroup" select="@__begingroup = 'True'" />
            <xsl:variable name="StartNewColumn" select="@__begincolumn = 'True'" />
            <xsl:choose>
              <xsl:when test="$cbq_isgrouping != 'True'">
                <xsl:if test="$CurPosition = $FirstRow">
                  <xsl:value-of disable-output-escaping="yes" select="$BeginColumn" />
                </xsl:if>
              </xsl:when>
              <xsl:when test="$StartNewGroup and $StartNewColumn">
                <xsl:choose>
                  <xsl:when test="$CurPosition = $FirstRow">
                    <xsl:value-of disable-output-escaping="yes" select="$BeginColumn" />
                    <xsl:call-template name="OuterTemplate.CallHeaderTemplate"/>
                  </xsl:when>
                  <xsl:otherwise>
                    <xsl:call-template name="OuterTemplate.CallFooterTemplate"/>
                    <xsl:value-of disable-output-escaping="yes" select="concat($EndColumn, $BeginColumn)" />
                    <xsl:call-template name="OuterTemplate.CallHeaderTemplate"/>
                  </xsl:otherwise>
                </xsl:choose>
              </xsl:when>
              <xsl:when test="$StartNewGroup">
                <xsl:call-template name="OuterTemplate.CallFooterTemplate"/>
                <xsl:call-template name="OuterTemplate.CallHeaderTemplate"/>
              </xsl:when>
              <xsl:when test="$StartNewColumn">
                <xsl:choose>
                  <xsl:when test="$CurPosition = $FirstRow">
                    <xsl:value-of disable-output-escaping="yes" select="$BeginColumn" />
                  </xsl:when>
                  <xsl:otherwise>
                    <xsl:value-of disable-output-escaping="yes" select="concat($EndColumn, $BeginColumn)" />
                  </xsl:otherwise>
                </xsl:choose>
              </xsl:when>
              <xsl:otherwise>
              </xsl:otherwise>
            </xsl:choose>
            <xsl:call-template name="OuterTemplate.CallItemTemplate">
              <xsl:with-param name="CurPosition" select="$CurPosition" />
            </xsl:call-template>
            <xsl:if test="$CurPosition = $LastRow">
              <xsl:if test="$cbq_isgrouping = 'True'">
                <xsl:call-template name="OuterTemplate.CallFooterTemplate"/>
              </xsl:if>
              <xsl:value-of disable-output-escaping="yes" select="$EndColumn" />
            </xsl:if>
          </xsl:if>
        </xsl:for-each>
      </xsl:template>
      <xsl:template name="OuterTemplate.CallHeaderTemplate">
        <xsl:value-of disable-output-escaping="yes" select="$BeginListItem" />
        <xsl:apply-templates select="." mode="header">
        </xsl:apply-templates>
        <xsl:value-of disable-output-escaping="yes" select="$BeginList" />
      </xsl:template>
      <xsl:template name="OuterTemplate.CallItemTemplate">
        <xsl:param name="CurPosition" />
        <xsl:value-of disable-output-escaping="yes" select="$BeginListItem" />
        <xsl:choose>
          <xsl:when test="@Style='NewsRollUpItem'">
            <xsl:apply-templates select="." mode="itemstyle">
              <xsl:with-param name="EditMode" select="$cbq_iseditmode" />
            </xsl:apply-templates>
          </xsl:when>
          <xsl:when test="@Style='NewsBigItem'">
            <xsl:apply-templates select="." mode="itemstyle">
              <xsl:with-param name="CurPos" select="$CurPosition" />
            </xsl:apply-templates>
          </xsl:when>
          <xsl:when test="@Style='NewsCategoryItem'">
            <xsl:apply-templates select="." mode="itemstyle">
              <xsl:with-param name="CurPos" select="$CurPosition" />
            </xsl:apply-templates>
          </xsl:when>
          <xsl:otherwise>
            <xsl:apply-templates select="." mode="itemstyle">
              <xsl:with-param name="CurPos" select="$CurPosition" />
            </xsl:apply-templates>
          </xsl:otherwise>
        </xsl:choose>
        <xsl:value-of disable-output-escaping="yes" select="$EndListItem" />
      </xsl:template>
      <xsl:template name="OuterTemplate.CallFooterTemplate">
        <xsl:value-of disable-output-escaping="yes" select="$EndList" />
        <xsl:value-of disable-output-escaping="yes" select="$EndListItem" />
      </xsl:template>
      <xsl:template name="OuterTemplate.GetSafeLink">
        <xsl:param name="UrlColumnName"/>
        <xsl:if test="$UseCopyUtil = 'True'">
          <xsl:value-of select="concat($RootSiteRef,'/_layouts/CopyUtil.aspx?Use=id&amp;Action=dispform&amp;ItemId=',@ID,'&amp;ListId=',@ListId,'&amp;WebId=',@WebId,'&amp;SiteId=',$SiteId,'&amp;Source=',$Source)"/>
        </xsl:if>
        <xsl:if test="$UseCopyUtil != 'True'">
          <xsl:call-template name="OuterTemplate.GetSafeStaticUrl">
            <xsl:with-param name="UrlColumnName" select="$UrlColumnName"/>
          </xsl:call-template>
        </xsl:if>
      </xsl:template>
      <xsl:template name="OuterTemplate.GetTitle">
        <xsl:param name="Title"/>
        <xsl:param name="UrlColumnName"/>
        <xsl:param name="UseFileName" select="0"/>
        <xsl:choose>
          <xsl:when test="string-length($Title) != 0 and $UseFileName = 0">
            <xsl:value-of select="$Title" />
          </xsl:when>
          <xsl:when test="$UseCopyUtil = 'True' and $UseFileName = 0">
            <xsl:value-of select="$BlankTitle" />
          </xsl:when>
          <xsl:otherwise>
            <xsl:variable name="FileNameWithExtension">
              <xsl:call-template name="OuterTemplate.GetPageNameFromUrl">
                <xsl:with-param name="UrlColumnName" select="$UrlColumnName" />
              </xsl:call-template>
            </xsl:variable>
            <xsl:choose>
              <xsl:when test="$UseFileName = 1">
                <xsl:call-template name="OuterTemplate.GetFileNameWithoutExtension">
                  <xsl:with-param name="input" select="$FileNameWithExtension" />
                </xsl:call-template>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="$FileNameWithExtension" />
              </xsl:otherwise>
            </xsl:choose>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:template>
      <xsl:template name="OuterTemplate.FormatColumnIntoUrl">
        <xsl:param name="UrlColumnName"/>
        <xsl:variable name="Value" select="@*[name()=$UrlColumnName]"/>
        <xsl:if test="contains($DataColumnTypes,concat(';',$UrlColumnName,',URL;'))">
          <xsl:call-template name="OuterTemplate.FormatValueIntoUrl">
            <xsl:with-param name="Value" select="$Value"/>
          </xsl:call-template>
        </xsl:if>
        <xsl:if test="not(contains($DataColumnTypes,concat(';',$UrlColumnName,',URL;')))">
          <xsl:value-of select="$Value"/>
        </xsl:if>
      </xsl:template>
      <xsl:template name="OuterTemplate.FormatValueIntoUrl">
        <xsl:param name="Value"/>
        <xsl:if test="not(contains($Value,', '))">
          <xsl:value-of select="$Value"/>
        </xsl:if>
        <xsl:if test="contains($Value,', ')">
          <xsl:call-template name="OuterTemplate.Replace">
            <xsl:with-param name="Value" select="substring-before($Value,', ')"/>
            <xsl:with-param name="Search" select="',,'"/>
            <xsl:with-param name="Replace" select="','"/>
          </xsl:call-template>
        </xsl:if>
      </xsl:template>
      <xsl:template name="OuterTemplate.Replace">
        <xsl:param name="Value"/>
        <xsl:param name="Search"/>
        <xsl:param name="Replace"/>
        <xsl:if test="contains($Value,$Search)">
          <xsl:value-of select="concat(substring-before($Value,$Search),$Replace)"/>
          <xsl:call-template name="OuterTemplate.Replace">
            <xsl:with-param name="Value" select="substring-after($Value,$Search)"/>
            <xsl:with-param name="Search" select="$Search"/>
            <xsl:with-param name="Replace" select="$Replace"/>
          </xsl:call-template>
        </xsl:if>
        <xsl:if test="not(contains($Value,$Search))">
          <xsl:value-of select="$Value"/>
        </xsl:if>
      </xsl:template>
      <xsl:template name="OuterTemplate.GetSafeStaticUrl">
        <xsl:param name="UrlColumnName"/>
        <xsl:variable name="Url">
          <xsl:call-template name="OuterTemplate.FormatColumnIntoUrl">
            <xsl:with-param name="UrlColumnName" select="$UrlColumnName"/>
          </xsl:call-template>
        </xsl:variable>
        <xsl:value-of select="cmswrt:EnsureIsAllowedProtocol($Url)"/>
      </xsl:template>
      <xsl:template name="OuterTemplate.GetColumnDataForUnescapedOutput">
        <xsl:param name="Name"/>
        <xsl:param name="MustBeOfType"/>
        <xsl:if test="contains($DataColumnTypes,concat(';',$Name,',',$MustBeOfType,';'))">
          <xsl:value-of select="@*[name()=$Name]"/>
        </xsl:if>
      </xsl:template>
      <xsl:template name="OuterTemplate.GetPageNameFromUrl">
        <xsl:param name="UrlColumnName"/>
        <xsl:variable name="Url">
          <xsl:call-template name="OuterTemplate.FormatColumnIntoUrl">
            <xsl:with-param name="UrlColumnName" select="$UrlColumnName"/>
          </xsl:call-template>
        </xsl:variable>
        <xsl:call-template name="OuterTemplate.GetPageNameFromUrlRecursive">
          <xsl:with-param name="Url" select="$Url"/>
        </xsl:call-template>
      </xsl:template>
      <xsl:template name="OuterTemplate.GetPageNameFromUrlRecursive">
        <xsl:param name="Url"/>
        <xsl:choose>
          <xsl:when test="contains($Url,'/') and substring($Url,string-length($Url)) != '/'">
            <xsl:call-template name="OuterTemplate.GetPageNameFromUrlRecursive">
              <xsl:with-param name="Url" select="substring-after($Url,'/')"/>
            </xsl:call-template>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="$Url"/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:template>
      <xsl:template name="OuterTemplate.GetGroupName">
        <xsl:param name="GroupName"/>
        <xsl:param name="GroupType"/>
        <xsl:choose>
          <xsl:when test="string-length(normalize-space($GroupName)) = 0">
            <xsl:value-of select="$BlankGroup"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:choose>
              <xsl:when test="$GroupType='URL'">
                <xsl:variable name="Url">
                  <xsl:call-template name="OuterTemplate.FormatValueIntoUrl">
                    <xsl:with-param name="Value" select="$GroupName"/>
                  </xsl:call-template>
                </xsl:variable>
                <xsl:call-template name="OuterTemplate.GetPageNameFromUrlRecursive">
                  <xsl:with-param name="Url" select="$Url"/>
                </xsl:call-template>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="$GroupName" />
              </xsl:otherwise>
            </xsl:choose>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:template>
      <xsl:template name="OuterTemplate.CallPresenceStatusIconTemplate">
        <xsl:if test="string-length(@SipAddress) != 0">
          <span class="presence-status-icon">
            <img src="/_layouts/images/imnhdr.gif" onload="IMNRC('{@SipAddress}')" ShowOfflinePawn="1" alt="" id="{concat('MWP_pawn_',$ClientId,'_',@ID,'type=sip')}"/>
          </span>
        </xsl:if>
      </xsl:template>
      <xsl:template name="OuterTemplate.GetFileNameWithoutExtension">
        <xsl:param name="input"/>
        <xsl:variable name="extension">
          <xsl:value-of select="substring-after($input, '.')"/>
        </xsl:variable>
        <xsl:choose>
          <xsl:when test="contains($extension, '.')">
            <xsl:variable name="afterextension">
              <xsl:call-template name="OuterTemplate.GetFileNameWithoutExtension">
                <xsl:with-param name="input" select="$extension"/>
              </xsl:call-template>
            </xsl:variable>
            <xsl:value-of select="concat(substring-before($input, '.'), $afterextension)"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:choose>
              <xsl:when test="contains($input, '.')">
                <xsl:value-of select="substring-before($input, '.')"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="$input"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:template>
    </xsl:stylesheet>
  4. Create a custom list with the following settings
    Columns
    Name Type Status Source
    Title Single line of text Required Item
    SubTitle Publishing HTML Optional
    ArticleDate Date and Time Optional
    Page Content Publishing HTML Optional
    ImageFile Image Uploader Optional
    Archived Status Choice Optional
    Business Category Managed Metadata Optional
  5. Add the following style to your CSS file
    .pagerSC {
        clear: both;
        background: #3E3E3E;
        margin: 0;
        border: 5px solid #313131;
        font-size: 0.8em;
        font-family: Tahoma, Arial, Helvetica, Sans-serif;
        height: 23px;
    }
    .pagerSC a, .pagerSC span {
        display: block;
        float: right;
        padding: 0.3em 0.5em 0.3em 0.5em;
        margin-right: 0.1em;
        text-decoration: none !important;
        background: #3E3E3E;
        color: #ffffff !important;
        line-height: 17px;
    }
    .pagerSC span {
        color: #EC5210 !important;
        font-weight: bold;
    }
    .pagerSC a:hover {
        background: #EC5210 !important;
        text-decoration: none !important;
    }
    .pagerSC ul {
        margin: 0;
        padding: 0;
    }
    .pagerSC li {
        margin: 0;
        padding: 0;
    }
  6. Add the uploaded webpart in any webpart zone, then edit it to read from your news custom list

Displaying webparts in tabs from the same webpart zone

  1. Access the following URL and customize your tabs:
    http://www.pathtosharepoint.com/sharepoint-user-toolkit/Pages/Easy-Tabs-v5.aspx
  2. Read and accept the license terms then copy the generated script in a text file and name it anything. for example "easytabs.text".
  3. Create a "utilities" folder in the root of your website and copy "easytabs.text" to it using "SharePoint Designer".
  4. From you browser, navigate to the page which has the webparts you want to tab it.
  5. Put all webparts you want to tab it in the same webpart zone.
  6. Insert a content editor webpart below all these webparts.
  7. Edit this content editor webpart by adding "/utilities/easytabs.text" without the quotation in the "content link" field.
  8. From the "Appearance" tab, delete the title text.
  9. From the "Layout" tab select "hidden"
  10. Save the settings.

Add Webpart zone on Masterpage in SharePoint 2010

  1. In your masterpage add the webpart zone wherever you want:
    <asp:ContentPlaceHolder id="MyWebpartZone" runat="server"></asp:ContentPlaceHolder>
  2.  Add the following tag anywhere in your layout pages
    <asp:Content ContentPlaceHolderId="WeatherPart" runat="server">
    <div>
    <WebPartPages:WebPartZone runat="server" Title="WeatherPart" ID="WeatherPart"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone>
    </div>
    </asp:Content>