Search

Hi Cremol,

There are inconsistencies in the services for sure... I also use conditional statements to output what I need.

I have been digging a bit deeper in this extension and found another bug
When removing a oEmbed field, i get the following error in my xml:

<error>Missing argument 1 for XMLElement::__construct(), called in /home//public_html/dev1/extensions/oembed_field/fields/field.oembed.php on line 364 and defined</error>

And it breaks up all following entries

Fancy filing a bug on Nitriques github repo for it?

All issues are tracked and dealt with here. If I have time over weekend, will dig about and see whats what.

done

EDIT: and fixed already! (even before i posted it!)

Hah, speedy coding there!

Hi guys, can anyone think of a way to inject: wmode=transparent into the returned iframe <html> nodes oembed?

For example, I want to overlay some button graphics to the left and right of the videos using a JS Anything Slider script.. all works well with object embed methods but because youtube and vimeo are now using iframes for their oembed methods, I can no longer place graphics above my vids.

I can do it for images but because the wmode=transparent is omitted from the returned <html> node value, I can't place my icons above the vids anymore .. boo hisss :(.. any pointers?

So I'm thinking I'd need a little regex to locate the ? and place the wmode param there and apend the rest of the string after it.. is this overkill or do you think it's possible?

EDIT

If you are able to append iframe=false to the url string.. you will get the object embed method back instead of the iframe method.. short term solution I guess!

Hi Moonoo,
Maybe you could try to import the iframe into a div container together with the buttons
Then you could position the buttons absolute within the div container and give them a higher z-index then the iframe... and position them where ever you like.

Hi Cremol, tried that. iframes take highest level in the stack within the DOM always, unless wmode param is used. And since the wmode=opaque or wmode=transparent needs to be set in the returned oembed node.. I can't affect it.. I'm using the AnythingSlider Javascript.. which is pretty sweet.. but I need my buttons to appear on top of the videos and only wmode param will allow this. I've left it for now, but will need to investigate further as to which services can allow this.

I might give the AnythingSlider a try soon, looks cool

Haven't tested this, but maybe this jquery would work...

$(document).ready(function(){
    $("iframe").attr('wmode', 'transparent');
    }
);

Found this which might work actually..

Needed it to cater for users who might already have params in theri query strings..

I'm also using head.js to offload the js to the footer to avoid loading bottlenecks on the page!

EDIT Woop got it working! Thanks Cremol for the idea! great stuff

Used this:

 $("iframe").each(function(){
    var ifr_source = $(this).attr('src');
    var wmode = "wmode=transparent";
    if(ifr_source.indexOf('?') != -1) {
        var getQString = ifr_source.split('?');
        var oldString = getQString[1];
        var newString = getQString[0];
        $(this).attr('src',newString+'?'+wmode+'&amp;'+oldString);
    }
    else $(this).attr('src',ifr_source+'?'+wmode);
});

Was using <xsl:text> and needed to swap it to <xsl:comment> js code here //<xsl:comment> for my inline JS stuff.. kept on getting CDATA issues with <xsl:text> but thanks to the lovely people on this forum.. it's already been documented and now IT WORKETH!! BY JOE IT DOES :)

Forgive me if this is a stupid question but how do I get these videos to display in my articles? It shows up in the back-end just fine and works properly n everything... I've just no idea how to physically get it showing for the end user. Do I type something in my article?

Hi Etch, have you added your oembed field to your article datasource?

You should then see in your xml by apending ?debug to your front end page.. something like yourarticledatasoyrce/oembed/html to get it into your xsl and therefore front end page.

The HTML node in the oembed XML should contain either <object> <embed> markup or <iframe> markup for the video output all there for you.

You might also need to use this sort of approach depending on what output it provides you.. i.e vimeo and youtube markup is already entity encoded i.e < and > are rendered as &lt; and &gt; inside the html node.. and might need you to use disable-output-escaping="yes" on your xsl markup.. needs confirming but I think I had to do this last time I checked! so your xsl would look like this:

<xsl:value-of select="yourarticledatasource/oembed/html" disable-output-escaping="yes"/>

I hadn't done that but it's done now and still not showing on the article page... That said, neither are some of the other things like time posted and weekday, etc. But they are out of choice. It is now showing on the debug though so there is some progress!

Is there any chance it could be because the width of the embed is wider than my container? That still seems kind of unlikely. I must have missed something somewhere.. do I have to call it with XSL or anything like that? I'm still very new to this.

Oh and where do I put that xsl line there? It does indeed render with the output escaped.

Yes, you will have to call the oembed into your template using xslt.

Could you pastie.org your template for us, and I can show you where to put the code if you like.

Also it would be good to get a screen grab of your debug output so we could help point you in the right direction.

Ahh righty. Yeah that makes sense then. I've also not set up JIT or anything like that yet either.

This is the get-article template, where I am trying to have this showing. Just try to ignore my clumsy coding. I've also attached a screen grab of the embed area of the debug.

I didn't think of this before.. But I am running 2.2.5 if that could be an issue.

Attachments:
Screen Shot 2011-11-27 at 19.55.45.png

See attached Pastie: http://www.pastie.org/2930155

I've commented above and below the line so you can see it clearly.

Thanks a lot man, that's spot on! :) Surprised me with a youtube vid I'd randomly attached to the default article as well lol

Is there a way to position these in the article? For some reason the youtube one randomly displayed after the second paragraph. Also does JIT or something size these for you?

Thanks again, I'd never have figured that one out lol.

The fact that it appears after the second paragraph is down to the Ninja technique used to split the text up.. it counts 2 paragraphs then places the images and the video embeded there, then renders the other paragraphs see here:

<div class="article">

<!-- This line has a formula that looks for the body text that is less than or equal to 2 and renders it as html using the ninja transformation technique --> 

    <xsl:apply-templates select="body/*[position() &lt;= 2]" mode="html"/>

<!-- then some images -->
    <xsl:call-template name="get-images">
        <xsl:with-param name="entry-id" select="@id"/>
    </xsl:call-template>
<!- Then the embed code -->

<!-- this is where I would place your embed script -->

            <xsl:value-of select="embed/oembed/html" disable-output-escaping="yes"/>

<!-- Notice the path is refering to embed/oembed/html that's because were already inside the homepage-article/entry part of the path -->


<!-- then body copy that the count is greater then 2 and also less than 4 paragraphs -->

        <xsl:apply-templates select="body/*[position() &gt; 2 and position() &lt;= 4]" mode="html"/>
            <xsl:if test="$is-logged-in = 'true'">
                <xsl:text> &#8212; </xsl:text>
                <a class="edit" href="{$root}/symphony/publish/{../section/@handle}/edit/{@id}/">Edit</a>
            </xsl:if>
</div>

So you can move the embed script above all the body copy or below it all.. do as you see fit really.

Ok dude. That makes a lot more sense now. Thanks for all the help. This has been super useful. I'll save further questions for relevant topics :) cheers!

My pleasure dude :) ... just passing on the community love ! enjoy.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details