Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

GoGrid - Deploy a Windows Server in the Cloud in Minutes!
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
WebHostForAsp.net
 


  Sponsors  

Meet Our Sponsors

WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
OnyakTech
The best choice for your web site host, email hosting, and domain registration.
CrystalTech Web Hosting™
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  Iframe Module [...  Feature Request -- IFrame Auto Resizing
Previous Previous
 
Next Next
New Post 12/19/2007 4:21 PM
User is offline Vitaly Kozadayev
671 posts
www.continure.com
7th Ranked






Re: Feature Request -- IFrame Auto Resizing 

http://www.dynamicdrive.com/dynamicindex17/iframessi2.htm


Vitaly Kozadayev
Principal
Viva Portals, L.L.C.
 
New Post 12/19/2007 9:34 PM
User is offline Stefan Cullmann
1431 posts
6th Ranked








Re: Feature Request -- IFrame Auto Resizing 

Vitaly,
I added a similiar script to the upcoming release. I knew this script before, however I stopped reading at the copyright line to avoid any legal issues.


Stefan Cullmann - stefan.cullmann [at] dotnetnuke.com

forms & Lists (UDT5.0) will be the next major release of the User Defined Table project.
A first Preview is available, though it requires DotnetNuke 5 (Beta 5).

 
New Post 1/10/2008 8:09 AM
User is offline Nathan Truhan
27 posts
10th Ranked


Re: Feature Request -- IFrame Auto Resizing 

Hello,

I looked at the code you did on the IFrame.  Nice work.  One thing, since the user probably doesn't want to see the error about null or is nothing when trying to re-size the iframe on a site outside the domain, I edited the portion of the Resize String block in the catch to look like:

                                                            + "catch(err){ " _
                                                            + "var re = /null or not an object$/i;" _
                                                            + "if (re.test(err.message)) {}" _
                                                            + "  else { window.status = err.message; }" _
                                                            + "}}"

Also, I have been working on a module on and off myself over the years called Content Links that I have published here on the forums a few times also for various DNN versions.  Well, I basically take the Links module and allow you to render a link inside a Pane as well as a new window or the entire window.  In doing so, I have to pseudo-inject an IFRAME into the Pane to get it to do this and pass it the parameters, hence I was running into the same issue with height.

Looking at the posts, the 100% height, doesn't work for IFRAME by itself, BUT if the container also has a 100% height, or possibly some height defined, I know it seems to work with 100% hieght, then it seems to stretch it.  It also worked for frames outside the domain.

Since I am injecting, what I did was locate the Pane I was referencing and inject the frame, with:

Private Function InjectIFrame(ByVal PaneID As String, ByRef htmIFrame As HtmlGenericControl) As Boolean
Dim ctlPane As Control
            Dim bRet As Boolean = False
            Dim strPane As String

            Try
                For Each strPane In PortalSettings.ActiveTab.Panes
                    If strPane.ToLower.Trim = PaneID.ToLower.Trim Then 'Make sure we are checking only valid Panes
                        ctlPane = DotNetNuke.UI.Skins.Skin.GetParentSkin(Me).FindControl(strPane)
                        If Not ctlPane Is Nothing Then
                            If ctlPane.ID.ToLower.Trim = PaneID.ToLower.Trim Then

                                'Mod Pane Style for 100% height if IFrame has 100% Height.
                                'Also Check For and Remove DNNEmptyPane Class Element From Pane

                                If TypeOf ctlPane Is HtmlControl Then
                                    With CType(ctlPane, HtmlControl)
                                        If .Style.Count > 0 Then
                                            If .Style.Value.Contains("height") Then
                                                .Style("height") = htmIFrame.Style("height")
                                            Else : .Style.Add("height", htmIFrame.Style("height"))
                                            End If
                                        Else : .Style.Add("height", htmIFrame.Style("height"))
                                        End If

                                        If .Attributes.Count > 0 Then
                                            Try
                                                .Attributes("class") = .Attributes("class").Replace(" DNNEmptyPane", "")
                                            Catch ex As Exception
                                            End Try
                                        End If
                                    End With
                                End If

                                ctlPane.Controls.Add(htmIFrame)
                                bRet = True
                            End If
                        End If
                    End If
                Next
            Catch
            End Try
            Return bRet
        End Function

In my links code, I was creating an IFRAME as htmIFrame, then I would pass it to this function and also pass the name of the Pane I want to inject it to, such as ContentPane or LeftPane as a string value.  In here, it would check if the IFRAME has a height set, if it does, it will set the Pane to be the same height.

In my generation of the iframe, I will add an htmIFRAME.Style.Add("height", "100%") and it seems to work fine and expands to the full height of the TD for the pane.

First time I think I have gotten it to work and it has taken me a few years on an off to also figure out I needed the GetParentSkin to refrence the correct Pane, otherwise you will wind up injecting into the wrong container.

Hope this helps someone.

 
New Post 1/10/2008 1:35 PM
User is offline Vitaly Kozadayev
671 posts
www.continure.com
7th Ranked






Re: Feature Request -- IFrame Auto Resizing 
Modified By Vitaly Kozadayev  on 1/10/2008 5:38:40 PM)

Very interesting post!

One note, however, in order to avoid confusion. 100% height is not the same as autosize, because autosize sets parameters to the same values as the page being "framed" whereas 100% height refers to the container tag of the IFRAME tag.

So, 100% height can be used to fill up the parent tag's space while autosize would shrink or stretch the iframe to the size of the page it displays. Of course, all of that is still subject to containing tags layout settings - for example overflow style, etc.


Vitaly Kozadayev
Principal
Viva Portals, L.L.C.
 
New Post 1/14/2008 7:31 AM
User is offline Nathan Truhan
27 posts
10th Ranked


Re: Feature Request -- IFrame Auto Resizing 

 Vitaly Kozadayev wrote

Very interesting post!

One note, however, in order to avoid confusion. 100% height is not the same as autosize, because autosize sets parameters to the same values as the page being "framed" whereas 100% height refers to the container tag of the IFRAME tag.

So, 100% height can be used to fill up the parent tag's space while autosize would shrink or stretch the iframe to the size of the page it displays. Of course, all of that is still subject to containing tags layout settings - for example overflow style, etc.

 

Very true.

Actually the code above is doing the opposite technically of the initial setting of the autosize, it is setting the parent container to be the same size as the IFRAME, which could be any value technically.  The reason I do this, is in the code that is calling this function I actually check the Pane to see if it has any width/height attributes defined and if it does, I add the attributes to the IFRAME.  If it does not, I add 100% width, height to the IFRAME, so in essence, if there was a pre-defined with/height, it would be re-assigned back to the pane, not causing any damage, but if there was not, it would propagate the 100% up, which would allow the IFRAME to fill the entire window.

You are correct as it does not handle re-sizing of the window when you re-size the parent window, but it will help in the initial sizing to pre-fill the entire window if you need it to.

I have noticed though on some skins, such as the default DNN skins, that if you only have 1 or 2 modules on the left and nothing on the right, since you are assigning a dynamic height, I think it is taking the height of the highest dynamic column.  In one case, I have 2 link modules which only takes about 1/2 the screen, so the pane only fills about 1/2 the screen, but that is all the taller the table row is because of the height of the link modules.  If I remove the 100% code, it only fills about 1/4 of the screen so it is stretching to the full height it knows about.  If you have a skin that has heights set for the panes, you can run code to itterate the attributes of the pane now that you can locate it and inherit the height/width of the pane and use it instead of 100%. 

 

 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  Iframe Module [...  Feature Request -- IFrame Auto Resizing
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Digicon: DotNetNuke design and development
Digicon is based in Brisbane, Queensland, Australia
digicon.com.au
Live Visitor Tracking & Live Chat For DotNetNuke
Track your visitors in real time and add live chat for sales & support. Free Trial.
www.whoson.com
SINA101
WANT A SPECial sIte iN TAIWAN?
sina101.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP