0

I am using ExpressionEngine 2.8.1 with Antenna 1.26

Here is my code:

{exp:channel:entries channel="uploaded_videos" orderby="title" sort="asc" status="open" dynamic="no"}
          <div class="col featured-business">
          <h2><a href="{title_permalink='visit/videos/'}" class="more">{title}</a></h2>
            <div class="text">
            <p>{ee_video_url}</p>
            {exp:antenna url='{ee_video_url}' max_width="232" max_height="323" cache_minutes="0"}
            <a href="{title_permalink='visit/videos/'}"><img src="{video_thumbnail}"></a>
            {if embed_code}
            It worked! {embed_code}
            {if:else}
            No video to display here.
            {/if}
            {video_title}
            {/exp:antenna}
            </div>
            <a href="{title_permalink='visit/videos/'}" title="View" class="more">Watch Video&hellip;</a>
          </div>
          {/exp:channel:entries}

Within exp:antenna url='' hardcoding a youtube video url works perfectly fine. However as soon as I enter {ee_video_url} it doesn't work. But I have displayed {ee_video_url} above this within the p tags so i know it is not empty.

This is baffling me as logically it should work to remove a hardcoded url and replace it with a variable one, any help on this would be appreciated.

5
  • 1
    Just looking at the Antenna docs, is this set correct in the Channel preferences? NOTE: For this to work with all urls please ensure that in Weblog/Channel -> Preferences, you have ‘Automatically turn URLs and email addresses into links?’ set to ‘No’. (As to why it makes a difference, I don't know. But by default it's set to "Yes", so maybe this is the cause?)
    – Banta
    Jul 17, 2014 at 15:01
  • Thank you for response but I have it set to 'No' so this shouldn't be causing the issue. Jul 17, 2014 at 15:17
  • Just discovered that <a href="{ee_video_url}">{ee_video_url}</a> displays: href="<p>youtube.com/watch?v=o8vfa0BIbgE</p>" so it is adding <p> tags to my link... possibly the cause to the issue. Jul 17, 2014 at 15:29
  • Now that's weird. The line above the exp:antenna call out where you have "<p>{ee_video_url}</p>", if you remove the <p> tags there, is it adding the <p> tags in the source code? Also, what does the source code show where the Antenna code is being outputted? Are there P tags around the link?
    – Banta
    Jul 17, 2014 at 15:36
  • 1
    Solved the issue thank you everyone, It seems that within the channel field it had a default formatting of XHTML. This needed changing to none and was why the channel field was automatically adding the <p> tags for me. Thank to all who answered, I will leave this up for anyone who has a future issue with this. Jul 17, 2014 at 15:39

1 Answer 1

2

Solved the issue thank you everyone, I only discovered what was happening after using:

<a href="{ee_video_url}">{ee_video_url}</a>

This ended up displaying my link with added p tags like so as:

<p>http://www.youtube.co.uk/exampleurl</p>

It seems that within the channel field for the video URL, it had a default formatting of XHTML.

This needed changing to NONE and was why the channel field was automatically adding the p tags either side of the URL in browser for me. Which meant the embed didn't work.

After removing the formatting on the channel field in expression engine the embed now works perfectly.

Thank to all who answered, I will leave this up for anyone who has a future issue with this.

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.