Django-cms:添加一个带占位符的视频

时间:2015-06-10 02:50:44

标签: html django django-cms

我正在尝试学习使用 django-cms

我正在尝试在默认页面上添加视频(来自 youtube )。 我试图通过直接在模板中复制 iframe (您可以直接从youtube复制的代码,参见图片),然后使用管理界面(添加视频)在占位符中使用youtube链接。)

enter image description here

我使用 iframe 取得了成功,但占位符取得了成功:我只获得了一个黑色矩形。

enter image description here

以下是开发服务器呈现的代码:

<div>
  <div class="cms_placeholder cms_placeholder-6"></div>
  <div class="cms_plugin cms_plugin-18">
    <div class="plugin_video">
      <object id="video-plugin-18" width="420" height="315" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" >
        <param name="movie" value="/static/cms/swf/player.swf"/>
        <param name="allowFullScreen" value="true" />
        <param name="allowScriptAccess" value="always" />
        <param name="allowFullScreen" value="true" /><param name="quality" value="autohigh" />
        <param name="wmode" value="opaque" />
        <param name="bgcolor" value="#000000" />
        <param name="flashvars" value="movie=https://www.youtube.com/watch?v=ynsBhCXm5Jk&amp;autoplay=false&amp;loop=false&amp;autohide=false&amp;fullscreen=true&amp;color_text=0xFFFFFF&amp;color_seekbar=0x13ABEC&amp;color_loadingbar=0x828282&amp;color_seekbarbg=0x333333&amp;color_button_out=0x333333&amp;color_button_over=0x000000&amp;color_button_highlight=0xFFFFFF" />
        <!--[if !IE]>-->
        <object width="420" height="315" data="/static/cms/swf/player.swf" type="application/x-shockwave-flash">
          <param name="allowFullScreen" value="true" />
          <param name="allowScriptAccess" value="always" />
          <param name="allowFullScreen" value="true" /><param name="quality" value="autohigh" />
          <param name="wmode" value="opaque" /><param name="bgcolor" value="#000000" />
          <param name="flashvars" value="movie=https://www.youtube.com/watch?v=ynsBhCXm5Jk&amp;autoplay=false&amp;loop=false&amp;autohide=false&amp;fullscreen=true&amp;color_text=0xFFFFFF&amp;color_seekbar=0x13ABEC&amp;color_loadingbar=0x828282&amp;color_seekbarbg=0x333333&amp;color_button_out=0x333333&amp;color_button_over=0x000000&amp;color_button_highlight=0xFFFFFF" />
          <!--<![endif]--><!-- alternate content -->
          Missing flash plugin. Please download the latest Adobe Flash Player: <br />
          <a href="https://www.adobe.com/go/getflashplayer">
            <img alt="Get Adobe Flash Player" src="/static/cms/img/icons/plugins/get_flash_player.gif" />
          </a>
          <!-- /alternate content --><!--[if !IE]>-->
        </object>
        <!--<![endif]-->
      </object>
    </div>
  </div>
  <iframe width="420" height="315" src="https://www.youtube.com/embed/ynsBhCXm5Jk" frameborder="0" allowfullscreen>
  </iframe>
  </div>

我不知道为什么会出现这个问题,这是 pip冻结的内容:

dj-database-url==0.3.0
Django==1.7.8
django-classy-tags==0.6.1
django-cms==3.1.0
django-reversion==1.8.5
django-sekizai==0.8.1
Django-Select2==4.3.1
django-treebeard==3.0
djangocms-admin-style==0.2.7
djangocms-column==1.5
djangocms-file==0.1
djangocms-flash==0.2.0
djangocms-googlemap==0.2
djangocms-inherit==0.1
djangocms-installer==0.7.7
djangocms-link==1.6.1
djangocms-picture==0.1
djangocms-style==1.5
djangocms-teaser==0.1
djangocms-text-ckeditor==2.5.2
djangocms-video==0.1
html5lib==0.99999
Pillow==2.8.0
pytz==2015.4
six==1.9.0
tzlocal==1.1.3
wheel==0.24.0

我使用了原始项目的默认页面。 我刚刚在 feature.html 模板中添加了一些代码:

{% extends "base.html" %}
{% load cms_tags staticfiles sekizai_tags menu_tags %}

{% block title %}{% page_attribute 'page_title' %}{% endblock title %}

{% block content %}
<div class="jumbotron">
  {% placeholder "feature" %}
</div>
<!-- from here -->
<div>
  {% placeholder "test" %}
<iframe width="420" height="315" src="https://www.youtube.com/embed/ynsBhCXm5Jk" frameborder="0" allowfullscreen></iframe>
</div>
<!-- to here -->
<div>
  {% placeholder "content" %}
</div>
{% endblock content %}

并通过管理界面添加了第一个视频。

如何添加带占位符的视频?

0 个答案:

没有答案