Facebook页面iFrame在Bootstrap模板中显示问题,同时使用Laravel作为后端发送iframe代码[重复]

问题描述 投票:0回答:1

这个问题在这里已有答案:

我正在使用bootstrap模板。我想在侧边栏中显示Facebook页面iFrame。我正在使用由Facebook Page Plugin生成的以下iFrame代码。这是代码:

<iframe src="https://www.facebook.com/plugins/page.php?href=https%3A%2F%2Fwww.facebook.com%2Ffaporbazmedia%2F&tabs=timeline&width=270&height=540&small_header=false&adapt_container_width=false&hide_cover=false&show_facepile=false&appId" width="270" height="540" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true" allow="encrypted-media"></iframe>

如果我直接将此代码放在模板中,它工作正常并显示Page iFrame。但是,如果我从后端上传此代码并在同一位置检索此代码,则不会显示iFrame。它显示原始代码!

这是图像。在顶部,我已经放置了直接代码,在底部我已经从MySQL数据库中检索了代码。

enter image description here

这是我试图显示iFrame的Laravel代码。

@if(isset($facebookpage))
    {{ $facebookpage->code }}
@endif
laravel twitter-bootstrap bootstrap-4 facebook-iframe
1个回答
0
投票

您需要像这样逃避Blade中的HTML

@if(isset($facebookpage))
    {!! $facebookpage->code !!}
@endif
© www.soinside.com 2019 - 2024. All rights reserved.