Hide RSS TICKER if no news


Item has a rating of 5 (Liked by Chris Graham)
#1558 (In Topic #319)
Standard member
ironfeather is in the usergroup ‘Well-settled’

display nothing if no news rather than a message saying that

Hello all,

Plugging away on my site adding content everyday and trying to modify things so they will make sense to Japanese folks. One thing I am doing is removing many of the bells and whistles, features etc to make it a super simple site so Japanese people with basic english can navigate.

I am enjoying the side block RSS news ticker by grabbing alerts from google news (they will provide a daily RSS if you want) so it works great mostly except sometimes their engine will include news that is not related but I am sure they will hone that eventually.  anyways, today there was no news and the stock "there is no news" is substituted… So I thought maybe I would just edit that to be a funny quote or image but instead I changed the template to check and not show the ticker at all if no content.  This is the same idea as what I posted the other day.

I should mention that for this RSS ticker I have the defer option ON…..  so as the ste is already loaded it checks to see if content, if so, shows the news, and if no content then moves along and no notices about it.  Major kudos to Chris for having this "defer" option, its powerful and awesome.



    <section id="tray_{TITLE|}" class="box box___block_side_rss">
        <h3 class="toggleable_tray_title">
            <a class="toggleable_tray_button" href="#" onclick="return toggleable_tray(this.parentNode.parentNode,false,'{TITLE|}');"><img alt="{!CONTRACT}: {$STRIP_TAGS,{TITLE`}}" title="{!CONTRACT}" src="https://compo.sr/themes/composr_homesite/images/1x/trays/contract2.png" srcset="https://compo.sr/themes/composr_homesite/images/2x/trays/contract2.png 2x" /></a>

                <a class="toggleable_tray_button" href="#" onclick="return toggleable_tray(this.parentNode.parentNode,false,'{TITLE|}');">{TITLE`}</a>

        <div class="toggleable_tray">
                <p class="nothing_here">{!NO_NEWS}</p>
                <div class="webstandards_checker_off">

        <script>// <![CDATA[
<!— stevyn test  —>
<!— stevyn test  —>


    <section class="box box___block_side_rss"><div class="box_inner">

            <p class="nothing_here">{!NO_NEWS}damn2</p>
            <div onmouseover="this.paused=true;" onmouseout="this.paused=false;" class="webstandards_checker_off wide_ticker" id="news_scroller{$GET%,side_news_id}">

    <script>// <![CDATA[
        var scroll_speed=60;
        var scroller=document.getElementById('news_scroller{$GET%,side_news_id}');
        if (scroller)
            if (scroller.scrollHeight<300) scroll_speed=300; // Slow, as not much to scroll
            window.setTimeout(function() {
                window.setInterval(function() {
                    var scroller=document.getElementById('news_scroller{$GET%,side_news_id}');
                    if (scroller.paused) return;
                    if (scroller.scrollTop+find_height(scroller)>=scroller.scrollHeight-1)
                } , scroll_speed);
            } ,2000);
<!— stevyn test  —>
<!— stevyn test  —>

Publisher of IronFeather Journal since 1987.  Host of KGNU Colorado Radio for 20 years. 
Currently in Japan & decided to focus on Composr as my number one CMS.
Composr site for community of Hokkaido:  Nandalow.com
Composr site for my freelance work: Futurecode.jp
My Compsr edits : 
Twitter: https://twitter.com/futurecodejp

Online now: No Back to the top
1 guest and 0 members have just viewed this.


Users online:

Manu, MVLipwig, amit.nigam, ManojSree, gabriel58

Forum statistics:
  • 1,298 topics, 5,830 posts, 7,065 members
  • Our newest member is raguragavan
Back to Top