Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Force a DNN page to load in an external FrameForce a DNN page to load in an external Frame
Previous
 
Next
New Post
3/2/2007 9:46 AM
 

As a way to migrate my existing ASP-Framed site to DNN I would like to be able to have specific DNN pages load in the content frame of my old site.

I have created a blank skin that works well and will display the page minus menues and navigation on my site.

So, If you navigate to a page on the old site, my page will show up in the frame without any problems.

Here is the difficult part:  If someone creates a link to the DNN page it shows up without navigation and not in the frame.

I would like to force the specific page to load in the framed site.

Here is some code I have used on non-DNN pages to accomplish this:

<code>

 <SCRIPT LANGUAGE="JavaScript">
   <!-- Begin
    ok_urls = new Array();
    ok_urls[1] = "http://www.mydomain.com/FramePage.asp";
    ok_urls[2] = "http://mydomain.com/FramePage.asp";

    url_found = 0;
    for (var i = 1; i <= ok_urls.length && !url_found; i++) {
    url_found = (parent.location.href.indexOf(ok_urls[i]) == -1);
    }
    if (!url_found || (window == top))
    top.location.href = ok_urls[1] + "?action=" + window.location.href;
    //  End -->
   </script>

</code>

 
New Post
3/5/2007 11:39 AM
 

After some research I found a wat to do this.

  1. I created a skin that had no menus etc. 
    Then added a script provided by John Mitchell  Here. (Thanks John).
  2. Here is the skin src.:
    <code>

    <%

    @ Control language="vb" CodeBehind="~/admin/Skins/skin.vb" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.UI.Skins.Skin" %>
    <link href="skin.css" rel="stylesheet" type="text/css" />
    <
    script runat="server">
    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
    'add a script reference for Javascript to the head section
    Dim oLink As New HtmlGenericControl("script")
    oLink.Attributes("language") = "javascript"
    oLink.Attributes("type") = "text/javascript"
    oLink.Attributes("src") = SkinPath & "Myframe.js"
    Dim oCSS As Control = Me.Page.FindControl("CSS")
    If Not oCSS is Nothing Then
    oCSS.Controls.AddAt(0, oLink)
    End if
    End Sub
    </script>
    <
    table class="cbframe" cellspacing="0" cellpadding="0" border="0" style="height: 100%; width=100%">
    <tr >
    <td class="toppane" id="toppane" runat="server" visible="false" vAlign="top" align="left" colspan="2" style="width: 100%"></td>
    </tr>
    <tr style="height: 100%">
    <td class="leftpane" id="leftpane" runat="server" visible="false" vAlign="top" align="left" ></td>
    <td id="contentPane" class="contentpane" runat="server" visible="false" vAlign="top" align="left" style="padding-right: 15px; padding-top: 5px;">
    </td>
    </tr>
    </
    table>
    </code>
  3. I added the following code the file named MyFrame.js located in my skin directory
    <code>  ok_urls = new Array();
      ok_urls[1] = "http://www.YourFrameDomain.com/FramesPage.asp";
      ok_urls[2] = "http://YourFrameDomain.com/FramesPage.asp";

      url_found = 0;
      for (var i = 1; i <= ok_urls.length && !url_found; i++) {
      url_found = (parent.location.href.indexOf(ok_urls[i]) == -1);
      }
      if (!url_found || (window == top))
      top.location.href = ok_urls[1] + "?action=" + window.location.href;
    </code>

  4. Be sure the page is open to non-registered users.

Then when I need to add a module to my existing (framed) site all I need to do is change the page skin and it is there.
If you need to edit the page simply go to admin/pages and select edit for the page.  Then change the skin temporarily.

I don't think I am the only one who might want to do this.  Hope it helps someone.

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Force a DNN page to load in an external FrameForce a DNN page to load in an external Frame


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out