如何让我的iframe代码在django cms中正确显示?

时间:2016-08-24 04:04:54

标签: html css django content-management-system

我正在使用django cms来创建我的网站和谷歌日历。但是,当我添加代码时,它只是简单的代码,不会显示日历。 这是我网站的链接: http://138.68.6.151:8000/en/events 有人可以解释如何解决这个问题吗?

2 个答案:

答案 0 :(得分:0)

我做了一些研究,发现我必须在settings.py

中添加以下内容

TEXT_ADDITIONAL_TAGS =('iframe',) TEXT_ADDITIONAL_ATTRIBUTES =('滚动','allowfullscreen','frameborder',

答案 1 :(得分:-1)

在访问您的网站并使用浏览器控制台检查您的iframe后,我发现iframe标记不正确(如引号中的文字),因此无法正确呈现。在您的段落标记中,iframe标记应采用以下方式:

<p><iframe frameborder="0" height="500" scrolling="no" src="https://calendar.google.com/calendar/embed?height=500&amp;amp;wkst=1&amp;amp;bgcolor=%23FFFFFF&amp;amp;src=6uemf0u3aqg89knqb4ndic0n04%40group.calendar.google.com&amp;amp;color=%23853104&amp;amp;ctz=America%2FChicago" style="border-width:0" width="500"></iframe></p>

为了验证这一点,在前端级别比赛后我得到了以下结果。

以前的状态(另请注意右侧的HTML代码)

enter image description here

在frond-end的代码中进行上述更改后(右边的通知,现在iframe标记突出显示为以前不是这种情况的标记):

enter image description here

因此,在您的情况下,iframe代码无法正常呈现。

由于您在Django CMS中使用iframe,因此提及in this stackoverflow post的配方将为您提供帮助。