1

I am relatively new to Craft and I came across the lovely plugin Embedder and I have managed to make good use of it.

For some reason, I don't manage to apply the paramters. I have followed the advice on the following post but still, don't manage to apply the vimeo paramters.

My code looks like that:

{% set video = craft.embedder.url(entry.workVideo, {max_width:5000, max_height:8000, vimeo_color:ffffff}) %}

{% if video %}
    <div class="work_video">
        {{ video.embed_code }}
    </div>
{% endif %}

All is fine beside the fact that the vimeo_color parameter doesn't work. I have tried other parameters like vimeo_autoplay:true also with no success.

  • I'm voting to "leave open" because it does not appear to be a bug report, and looks more likely to be user error. – Lindsey D Jun 19 '15 at 17:31
  • This question was also posted to Github (presumably by OP)... github.com/A-P/Embedder/issues/11 – Lindsey D Jun 19 '15 at 17:33
  • @Lindsey, I already suggested to put the value in quotes, but deleted the answer, as the OP said it didn't fix the issue. Looks like it's not a syntax problem. – carlcs Jun 19 '15 at 19:22
  • @carlcs I think you were on the right track, and was mainly echoing what you originally said. Because without quotes, Twig reads that as a variable, not a string. I only made a point about it because the OP's Github example still didn't have quotes around that string. – Lindsey D Jun 19 '15 at 19:32
  • @carlcs I'd actually wager that the quotes were the right answer, and the OP simply misunderstood you. You're spot on 99% of the time, why would this instance be any different? ;) – Lindsey D Jun 19 '15 at 19:34
5

Author of the plugin here - @Lindsey is correct - wrapping the color in quotes is the correct syntax. If you test it with this video, it works fine: https://vimeo.com/130900978

One thing to note - with Vimeo, a video owner can overwrite this option - so if they set it to a specific theme color, you can't change it through this embed parameter. For more info on the Vimeo API, you can see this documentation: https://developer.vimeo.com/player/embedding

|improve this answer|||||
  • In all fairness, I just reiterated the solution that @carlcs originally posted. Thanks for adding the official solution! And great note about the video owner's settings, probably a tricky thing to diagnose. – Lindsey D Jun 20 '15 at 4:35
  • Thank you! This was actually my problem. The video I was embedding was of a Vimeo Plus account with specific embedding setting that couldn't be overwritten. Maybe it is just important to notice that only Vimeo plus and pro users can overwrite styling options. – Less and More Collective Jun 20 '15 at 7:30
  • And it was not only the vimeo_color parameter that couldn't be overwritten, I have tried also vimeo_autoplay and I assume that other things won't work too. All together, great plugin! – Less and More Collective Jun 20 '15 at 7:33
3

Did you try to format the parameter like so:

vimeo_color: 'FFFFFF'

Update:

It is the right code I posted. So make sure to wrap the value in quotes, as otherwise Twig reads FFFFFF as a variable. Only numbers or a boolean false or true can be passed without.

And then, after you got your syntax right, go to CP Settings → Tools → Empty Cache and clear your "Data Caches". I just installed the plugin to test it and found out it uses caching and doesn't take into account that the user could change these parameters.

|improve this answer|||||
  • I have tried but I was not surprised that it didn't work. When you embed vimeo video, the color code is without #... – Less and More Collective Jun 18 '15 at 21:32
  • What about vimeo_color: 'FFFFFF' – carlcs Jun 18 '15 at 21:39
  • I must admit, I have tried this one too and some other more but still no success... – Less and More Collective Jun 18 '15 at 21:52
  • Ok, then I can't help. A string value should be in quotes, only numbers or booleans can be passed without. Without the quotes Twig looks for a variable FFFFFF. – carlcs Jun 18 '15 at 21:59
  • Did you try using the other output tags the plugin provides? (sorry for just guessing here, but I never used the plugin) – carlcs Jun 18 '15 at 22:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.