Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • James Hildeman 92 posts 88 karma points
    Jul 24, 2009 @ 19:21
    James Hildeman
    1

    More feeds in more places...

    I created another version of your renderFeed() that allows me to utilize your nifty creation in other places in my dashboards.  This one takes a feedname, if it's blank it uses the tabname logic you had, if not blank it uses the 'feedname' parm.  This allows me to add more feeds to your dashrss.config and then use them in columns or sidebars on other dashboard tabs.  Thanks for the cool tools.

    CODE in dashrss.js (changes in bold)

    fmDashRss.renderFeedExt = function(id, umbracoPath, feedname) {
        if(!fmDashRss.css) {
            fmDashRss.css = true;
            var script = f.createElement("link");
            script.setAttribute("rel", "stylesheet");
            script.setAttribute("type", "text/css");
            script.setAttribute("href", umbracoPath + fmDashRss.appVPath + '/dashrss.css');
            head.appendChild(script);
        }
       
        if(!fmDashRss.loadingGif) {
            fmDashRss.loadingGif = umbracoPath + fmDashRss.appVPath + '/ajax-loader.gif';
            fmDashRss.loadingGif = '<img src="'+fmDashRss.loadingGif+'" alt="Loading" width="16" height="16"/>';
        }
           
        if (feedname == "")
        {
          var containerId = $('#'+id).parent().parent().attr('id');
          containerId = containerId.replace(/^(.*?\_tab\d{2}).*$/, "$1");

          var tabName = $('#' + containerId + ' span nobr').html();
          fmDashRss.load(id, tabName, umbracoPath);
        }
        else
        {
          fmDashRss.load(id, feedname, umbracoPath);
        }

    }

    Example Code to utilize:

          <h3>Help</h3>
            <div id="rssdfblog" class="dashRss">     
            </div>
            <script type="text/javascript">
            <!--
              $(document).ready(function() {
                    $('.tabpagecontainer div:first').each(function() {
                        $(this).css({'display': 'block'});
                    });
                    fmDashRss.renderFeedExt('rssdfblog', '<%= ConfigurationManager.AppSettings["umbracoPath"] %>', 'Darren Ferguson');
              });       
            // -->
            </script>

     

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Jul 27, 2009 @ 10:12
    Darren Ferguson
    0

    Good stuff. Thanks!

    I'll revisit this package at a later point to add a few new whistles and bells, i'll try and incorporate your ideas at that point.

     

Please Sign in or register to post replies

Write your reply to:

Draft