Skip to main content
fixed type-o's, improved formatting, added tag
Source Link
RJ Cuthbertson
  • 8.4k
  • 6
  • 39
  • 76

Can't design content query web part by javascript news tickerDesign Content Query Web Part JavaScript News Ticker

I created a news list in SharePoint 2010 that shows news on the home page just like a news ticker with JavaScript. I used a content query web part to show news. This article is so useful, but doesn't work, maybe I`m. Maybe I'm wrong.

I modified page.aspx containing CQWP, ItemStyle.aspx, and ContentQueryMain.aspx in SharePoint Designer 2010. I downloaded JavaScript news ticker and uploaded it to the All Files folder. I did these steps to show news:

1-Added Added to page header that contains CQWP:

2-Added Added link reference to master page head:

3-Modified itmestyle Modified itemstyle:

4-Modifed Modifed ContentByQueryMain.xsl.:

In ContentByQueryMain.xsl search for the template "OuterTemplate.CallItemTemplate". This should contain an xsl choose statement. Find the "otherwise" part that looks similar to the below block:

5-Finally Finally create template ticker:

<xsl:template name="ticker" match="Row[@Style='ticker']" mode="itemstyle"> <xsl:param name="CurPos" />

<xsl:template name="ticker" match="Row[@Style='ticker']" 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:if test="$CurPos='1' ">    
        <xsl:variable name="JScript">
            <![CDATA[
                $(document).ready(function(){
            
     
                $('.ticker-news-item').each(function(){
                        var newItemString = "<li class='news-item'>" + $(this).html()+ "</li>";
                        $('#js-news').append(newItemString);
                        $(this).remove();
                    }); 
                
                    $('#js-news').ticker({
                });      
                });
            });]]>
        ]]>
    </xsl:variable> 
    
        <script type='text/javascript'>
            <xsl:value-of select="$JScript" disable-output-escaping="yes"/>
        </script>
        <div id="ticker-wrapper" class="no-js"><uljs">
            <ul id="js-news" class="js-hidden"></ul></div>ul>
        </div>
                             
    
 </xsl:if>

    <div class='ticker-news-item' ><a>
        <a href='{$SafeLinkUrl}' target='_blank'><xsltarget='_blank'>
            <xsl:value-of select="@Title" /><>
        </a><a>
    </div>  
</xsl:template>

</xsl:template>

6-Apply Apply this template on CQWP:

Can't design content query web part by javascript news ticker

I created a news list in SharePoint 2010 that shows news on the home page just like a news ticker with JavaScript. I used a content query web part to show news. This article is so useful but doesn't work, maybe I`m wrong.

I modified page.aspx containing CQWP, ItemStyle.aspx, ContentQueryMain.aspx in SharePoint Designer 2010. I downloaded JavaScript news ticker and uploaded it to the All Files folder. I did these steps to show news:

1-Added to page header that contains CQWP

2-Added link reference to master page head

3-Modified itmestyle

4-Modifed ContentByQueryMain.xsl. In ContentByQueryMain.xsl search for the template "OuterTemplate.CallItemTemplate". This should contain an xsl choose statement. Find the "otherwise" part that looks similar to the below block:

5-Finally create template ticker:

<xsl:template name="ticker" match="Row[@Style='ticker']" 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:if test="$CurPos='1' ">    
    <xsl:variable name="JScript">
        <![CDATA[
            $(document).ready(function(){
                
                $('.ticker-news-item').each(function(){
                    var newItemString = "<li class='news-item'>" + $(this).html()+ "</li>";
                    $('#js-news').append(newItemString);
                    $(this).remove();
                }); 
                
                $('#js-news').ticker({
                });                     
            });
        ]]>
    </xsl:variable> 
    
    <script type='text/javascript'>
        <xsl:value-of select="$JScript" disable-output-escaping="yes"/>
    </script>
    <div id="ticker-wrapper" class="no-js"><ul id="js-news" class="js-hidden"></ul></div>
                                        
 </xsl:if>

<div class='ticker-news-item' ><a href='{$SafeLinkUrl}' target='_blank'><xsl:value-of select="@Title" /></a></div>  

</xsl:template>

6-Apply this template on CQWP

Can't Design Content Query Web Part JavaScript News Ticker

I created a news list in SharePoint 2010 that shows news on the home page just like a news ticker with JavaScript. I used a content query web part to show news. This article is so useful, but doesn't work. Maybe I'm wrong.

I modified page.aspx containing CQWP, ItemStyle.aspx, and ContentQueryMain.aspx in SharePoint Designer 2010. I downloaded JavaScript news ticker and uploaded it to the All Files folder. I did these steps to show news:

1- Added to page header that contains CQWP:

2- Added link reference to master page head:

3- Modified itemstyle:

4- Modifed ContentByQueryMain.xsl:

In ContentByQueryMain.xsl search for the template "OuterTemplate.CallItemTemplate". This should contain an xsl choose statement. Find the "otherwise" part that looks similar to the below block:

5- Finally create template ticker:

<xsl:template name="ticker" match="Row[@Style='ticker']" 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:if test="$CurPos='1' ">    
        <xsl:variable name="JScript">
            <![CDATA[
                $(document).ready(function(){
         
                    $('.ticker-news-item').each(function(){
                        var newItemString = "<li class='news-item'>" + $(this).html()+ "</li>";
                        $('#js-news').append(newItemString);
                        $(this).remove();
                    }); 
                
                    $('#js-news').ticker({ }); 
                });
            ]]>
        </xsl:variable> 
    
        <script type='text/javascript'>
            <xsl:value-of select="$JScript" disable-output-escaping="yes"/>
        </script>
        <div id="ticker-wrapper" class="no-js">
            <ul id="js-news" class="js-hidden"></ul>
        </div>
                             
    </xsl:if>

    <div class='ticker-news-item' >
        <a href='{$SafeLinkUrl}' target='_blank'>
            <xsl:value-of select="@Title" />
        </a>
    </div>  
</xsl:template>

6- Apply this template on CQWP:

I cant Can't design content query web part by javascript news ticker .

I createcreated a news list in share pointSharePoint 2010 that showshows news inon the home page just like a news ticker with JavaScript. I used a content query web part to show news. this article is so useful but doesn't work This article is so useful but doesn't work, maybe I`m wrong. I

I modified page.aspxpage.aspx containing CQWPCQWP, ItemStyle.aspxItemStyle.aspx, ContentQueryMain.aspxContentQueryMain.aspx in share point designerSharePoint Designer 2010.I I downloaded JavaScript news stickerticker and uploaded it to the All Files folder. I did these steps to show news:

1-addAdded to page header that contains CQWP

<link href="css/ticker-style.css" rel="stylesheet" type="text/css" />
    <script src="jquery.ticker.js" type="text/javascript"></script>

to page header that contains CQWP

3-modifiedModified itmestyle

4-modifed ContentByQueryMain.xslModifed ContentByQueryMain.xsl. In ContentByQueryMain.xslContentByQueryMain.xsl search for the template "OuterTemplate.CallItemTemplate". This should contain an xsl choose statement. Find the "otherwise" part that looks limilarsimilar to the below block:

5-finallyFinally create template ticker:

6-then applyApply this template on CQWP

AFTER THESE STEPS NOTHING CHANGE!!!!After these steps nothing changes.

I cant design content query web part by javascript news ticker .

I create news list in share point 2010 that show news in home page just like news ticker with JavaScript. I used content query web part to show news. this article is so useful but doesn't work, maybe I`m wrong. I modified page.aspx containing CQWP, ItemStyle.aspx, ContentQueryMain.aspx in share point designer 2010.I downloaded JavaScript news sticker and uploaded to All Files folder. I did these steps to show news:

1-add

<link href="css/ticker-style.css" rel="stylesheet" type="text/css" />
    <script src="jquery.ticker.js" type="text/javascript"></script>

to page header that contains CQWP

3-modified itmestyle

4-modifed ContentByQueryMain.xsl. In ContentByQueryMain.xsl search for the template "OuterTemplate.CallItemTemplate". This should contain an xsl choose statement. Find the "otherwise" part that looks limilar to the below block:

5-finally create template ticker:

6-then apply this template on CQWP

AFTER THESE STEPS NOTHING CHANGE!!!!

Can't design content query web part by javascript news ticker

I created a news list in SharePoint 2010 that shows news on the home page just like a news ticker with JavaScript. I used a content query web part to show news. This article is so useful but doesn't work, maybe I`m wrong.

I modified page.aspx containing CQWP, ItemStyle.aspx, ContentQueryMain.aspx in SharePoint Designer 2010. I downloaded JavaScript news ticker and uploaded it to the All Files folder. I did these steps to show news:

1-Added to page header that contains CQWP

<link href="css/ticker-style.css" rel="stylesheet" type="text/css" />
<script src="jquery.ticker.js" type="text/javascript"></script>

3-Modified itmestyle

4-Modifed ContentByQueryMain.xsl. In ContentByQueryMain.xsl search for the template "OuterTemplate.CallItemTemplate". This should contain an xsl choose statement. Find the "otherwise" part that looks similar to the below block:

5-Finally create template ticker:

6-Apply this template on CQWP

After these steps nothing changes.

Source Link
Hoorie
  • 195
  • 1
  • 1
  • 12

I cant design content query web part by javascript news ticker .

I create news list in share point 2010 that show news in home page just like news ticker with JavaScript. I used content query web part to show news. this article is so useful but doesn't work, maybe I`m wrong. I modified page.aspx containing CQWP, ItemStyle.aspx, ContentQueryMain.aspx in share point designer 2010.I downloaded JavaScript news sticker and uploaded to All Files folder. I did these steps to show news:

1-add

<link href="css/ticker-style.css" rel="stylesheet" type="text/css" />
    <script src="jquery.ticker.js" type="text/javascript"></script>

to page header that contains CQWP

2-Added link reference to master page head

<script type="text/javascript" src="../../jquery_news_ticker/includes/jquery.ticker.js"></script>
<script type="text/css" src="../../jquery_news_ticker/styles/ticker-style.css"></script>

3-modified itmestyle

<xsl:template name="simpleRowAndTitle" match="Row[@Style='simpleRowAndTitle']" mode="itemstyle">
    <xsl:param name="CurPos" />    
    <div class="item">    
        <span><xsl:value-of select="$CurPos" /></span> 
        <xsl:value-of select="@Title"/>        
    </div>
</xsl:template>

4-modifed ContentByQueryMain.xsl. In ContentByQueryMain.xsl search for the template "OuterTemplate.CallItemTemplate". This should contain an xsl choose statement. Find the "otherwise" part that looks limilar to the below block:

<xsl:otherwise>
    <xsl:apply-templates select="." mode="itemstyle">
        <xsl:with-param name="CurPos" select="$CurPosition" />
    </xsl:apply-templates>
</xsl:otherwise>

5-finally create template ticker:

<xsl:template name="ticker" match="Row[@Style='ticker']" 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:if test="$CurPos='1' ">    
    <xsl:variable name="JScript">
        <![CDATA[
            $(document).ready(function(){
                
                $('.ticker-news-item').each(function(){
                    var newItemString = "<li class='news-item'>" + $(this).html()+ "</li>";
                    $('#js-news').append(newItemString);
                    $(this).remove();
                }); 
                
                $('#js-news').ticker({
                });                     
            });
        ]]>
    </xsl:variable> 
    
    <script type='text/javascript'>
        <xsl:value-of select="$JScript" disable-output-escaping="yes"/>
    </script>
    <div id="ticker-wrapper" class="no-js"><ul id="js-news" class="js-hidden"></ul></div>
                                        
</xsl:if>

<div class='ticker-news-item' ><a href='{$SafeLinkUrl}' target='_blank'><xsl:value-of select="@Title" /></a></div>  

</xsl:template>

6-then apply this template on CQWP

AFTER THESE STEPS NOTHING CHANGE!!!!