Copied to clipboard

Flag this post as spam?

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


  • Ethan Wise 15 posts 85 karma points
    Nov 24, 2015 @ 09:13
    Ethan Wise
    0

    iframe XSLT macro unable to rezise iframe box

    Hi there,

    I am fairly new to umbraco, i spent many hours yesterday trying to create an iframe to embed a webpage within my website.

    I created an XSLT file and then created the macro needed, and after lots of tweaking finally got it working, HOWEVER, the only issue i now have is that i seem to be unable to change the size of the iframe, i have tried changing the values by right clicking and going to edit embedded media, i have tried changing it in HTML editor, i have tried changing it by clearing it and adding the macro and setting the size i want there, but everytime when i go to preview my page, the iframe is the same size?

    I am wondering if it is something to do with my XSLT code?

    I copied the code from a forum, and have attached a screen shot of mine here!

    enter image description here

    Any help would be ideal!

    Thanks,

    Ethan

  • Tom Engan 430 posts 1173 karma points
    Nov 24, 2015 @ 09:22
    Tom Engan
    0

    I use XSLT iFrame inside Grid (from ver. 7.2 and up) where I use the columnwidth as maximum width by putting iFrame as fixed width 100%. Is this a solution that you can use?

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet
      version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:msxml="urn:schemas-microsoft-com:xslt"
      xmlns:umbraco.library="urn:umbraco.library"
      xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" 
      xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" 
      xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" 
      xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" 
      xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" 
      xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" 
      xmlns:seoChecker.MetaData="urn:seoChecker.MetaData" 
      xmlns:PS.XSLTsearch="urn:PS.XSLTsearch"
      exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets seoChecker.MetaData PS.XSLTsearch ">
    
    <xsl:output method="xml" omit-xml-declaration="yes"/>
    
    <xsl:param name="currentPage"/>
    <xsl:variable name="location" select="/macro/location"/>
    <xsl:variable name="height" select="/macro/height"/>
    <xsl:template match="/">
    <iframe src="{$location}" height="{$height}" style="border:0; width: 100%">
        Beklager, din nettleser st√łtter ikke IFRAMES.
      </iframe>
    </xsl:template>
    </xsl:stylesheet>
    
  • Ethan Wise 15 posts 85 karma points
    Nov 24, 2015 @ 09:40
    Ethan Wise
    0

    Hi Tom,

    Thanks for this, so it almost works, i now have a wide but thin box, and unable to change the height or width still of the box. I would like to extend the width a bit more and also give the box more height?

    Thanks,

    Ethan

  • Tom Engan 430 posts 1173 karma points
    Nov 24, 2015 @ 09:58
    Tom Engan
    0

    Have you these settings? enter image description here enter image description here

    And when you insert content in the Grid, it loook like this (the width is set fixed to 100%, so you can't change the width with the use of code I showed above). Insert control, macro, chose macro: i Frame Insert:

    enter image description here

  • Tom Engan 430 posts 1173 karma points
    Nov 24, 2015 @ 09:38
    Tom Engan
    0

    iFrame will therefore fit inside one of these column width I have predefined in Data Type to Grid Page: enter image description here

  • Ethan Wise 15 posts 85 karma points
    Nov 24, 2015 @ 10:29
    Ethan Wise
    0

    Hi tom,

    So i have tried playing around with this for a while but still with no luck, i am using umbraco V4.8 so my UI doesnt look exactly the same as yours, but i have the same setting as you show above except the 'Use in rich text editor and the grid' is not an option, i just have 'use in editor' are these the same? but i have that ticked!

    I have attached a screen shot to better show my issue i am trying to explain

    enter image description here

    Here you can see the IFrame i am using and i want to resize it so that it will fill up the red box and that it goes as wide as the yellow line above,

    And no matter what number i put in the height setting when putting the iframe in it is always the same size shown in the screen shot!

    Thanks

    Ethan

  • Tom Engan 430 posts 1173 karma points
    Nov 24, 2015 @ 11:10
    Tom Engan
    0

    Ok, I have only worked with umbraco v7.x, and from umbraco V7.2 I've use the Grid all the time, so I'm not sure how it works in umbraco V4.8 when you ask about 'use in editor '..

    Hope someone else can answer your questions.

Please Sign in or register to post replies

Write your reply to:

Draft