Stump the Panel » Site Managers and Site Collection Managers

Display a web part (task) from one site to another site

(5 posts)
  1. Adam
    Member

    So the issues this that I have task list on subsite 1 (Sales dept) and subsite 2 (marketing dept)and I would like to display both tasks on the root site. This way when each department changes a task on their sites it would also reflect on the root site. I would also like to do this for announcements. So that I have the Announcements from all subsite displayed on the Main page of the Root site. We are running just the basic WSS 3.0. Any help is appreciated.

    Thanks,
    Adam

    Posted 5 months ago #
  2. Adam
    Member

    ok so i've been looking around some more and think I found my solution. Using the web part "Content Editor Web Part" and adding the following code while modifying the URL of the task list of the other site it displays.

    <!-- Load and display list - iframe version -->
    <!-- Questions and comments: [email protected] -->

    <DIV id="ListPlaceholder"><IMG src="/_layouts/images/GEARS_AN.GIF"></DIV>

    <!-- Paste the URL of the source list below: -->
    <iframe id="SourceList" style="display:none;" src="http://domain.com/SiteCollection/SourceSite/SourceList/MyView.aspx" onload="DisplayThisList()"></iframe>

    <script type="text/javascript">
    function DisplayThisList()
    {
    var placeholder = document.getElementById("ListPlaceholder");

    var displaylist = null;
    var sourcelist = document.getElementById("SourceList");

    try {
    if(sourcelist.contentDocument)
    // Firefox, Opera

    {displaylist = sourcelist.contentDocument.getElementById("WebPartWPQ1") ;}
    else if(sourcelist.contentWindow)
    // Internet Explorer

    {displaylist = sourcelist.contentWindow.document.getElementById("WebPartWPQ1") ;}
    else if(sourcelist.document)
    // Others?

    {displaylist = sourcelist.document.getElementById("WebPartWPQ1") ;}
    }
    catch(err) { alert ("Loading failed");}

    displaylist.removeChild(displaylist.getElementsByTagName("table")[0]);
    var allDescendants = displaylist.getElementsByTagName("*");
    for (i=0;i<allDescendants.length;i++) {
    allDescendants[i].removeAttribute("id");
    allDescendants[i].removeAttribute("onclick");
    allDescendants[i].removeAttribute("onfocus");
    allDescendants[i].removeAttribute("onmouseover");
    }
    placeholder.innerHTML = displaylist.innerHTML;
    }
    </script>

    <!-- Load and display list - iframe version -->
    <!-- Questions and comments: [email protected] -->

    <DIV id="ListPlaceholder"><IMG src="/_layouts/images/GEARS_AN.GIF"></DIV>

    <!-- Paste the URL of the source list below: -->
    <iframe id="SourceList" style="display:none;" src="http://domain.com/SiteCollection/SourceSite/SourceList/MyView.aspx" onload="DisplayThisList()"></iframe>

    <script type="text/javascript">
    function DisplayThisList()
    {
    var placeholder = document.getElementById("ListPlaceholder");

    var displaylist = null;
    var sourcelist = document.getElementById("SourceList");

    try {
    if(sourcelist.contentDocument)
    // Firefox, Opera

    {displaylist = sourcelist.contentDocument.getElementById("WebPartWPQ1") ;}
    else if(sourcelist.contentWindow)
    // Internet Explorer

    {displaylist = sourcelist.contentWindow.document.getElementById("WebPartWPQ1") ;}
    else if(sourcelist.document)
    // Others?

    {displaylist = sourcelist.document.getElementById("WebPartWPQ1") ;}
    }
    catch(err) { alert ("Loading failed");}

    displaylist.removeChild(displaylist.getElementsByTagName("table")[0]);
    var allDescendants = displaylist.getElementsByTagName("*");
    for (i=0;i<allDescendants.length;i++) {
    allDescendants[i].removeAttribute("id");
    allDescendants[i].removeAttribute("onclick");
    allDescendants[i].removeAttribute("onfocus");
    allDescendants[i].removeAttribute("onmouseover");
    }
    placeholder.innerHTML = displaylist.innerHTML;
    }
    </script>

    Posted 5 months ago #
  3. Do you have SPD? A linked data source (merge) might be easier and work better.

    Posted 5 months ago #
  4. I'm no coder, so here's how I'd do it:
    Use one of the following out-of-box web parts: User Tasks, Content Query Web part, or look at the other options in my blog here:
    http://spinsiders.com/laurar/2009/01/29/ways-to-display-multiple-document-libraries/

    Laura Rogers

    Posted 5 months ago #
  5. jaxkookie
    Member

    @AutoSponge, thanks for the idea. Found this post very helpful; http://office.microsoft.com/en-us/sharepointdesigner/HA101154041033.aspx

    @laura67, you always have great post. I have visited your site multiple times, the problem I have is my company is still on WSS 3.0, so I don't have access to the neat tools MOSS offers, like the CQWP. Does anyone know if these tools are something that can be add without MOSS?

    Posted 5 months ago #

RSS feed for this topic

Reply

You must log in to post.