Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Shopify 部分未显示Youtube URL_Shopify_Liquid_Shopify Template_Liquid Layout_Liquid Xml - Fatal编程技术网

Shopify 部分未显示Youtube URL

Shopify 部分未显示Youtube URL,shopify,liquid,shopify-template,liquid-layout,liquid-xml,Shopify,Liquid,Shopify Template,Liquid Layout,Liquid Xml,我对Liquid非常陌生,我正在尝试创建一个选项,用户可以输入YouTube链接,而视频在输入链接时不会出现。目前,我在schema标记中嵌入了另一个视频,以便视频可以显示 这是我目前的代码: <div> <div style="padding-top:56.17021276595745%" id="w-node-cdda72edcacb-27a794fe" class="w-embed-youtubevideo&quo

我对Liquid非常陌生,我正在尝试创建一个选项,用户可以输入YouTube链接,而视频在输入链接时不会出现。目前,我在schema标记中嵌入了另一个视频,以便视频可以显示

这是我目前的代码:

<div>
    <div style="padding-top:56.17021276595745%" id="w-node-cdda72edcacb-27a794fe" class="w-embed-youtubevideo">
        <iframe src="https://www.youtube.com/embed/J-sUpDMKWbc?rel=0&amp;controls=1&amp;autoplay=0&amp;mute=0&amp;start=0" frameborder="0" style="position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:auto" allow="autoplay; encrypted-media" allowfullscreen="">
        </iframe>
    </div>
</div>
{% schema %}
{
    "name": "Embed Youtube",
    "settings": [
        {
            "id": "video_url",
            "type": "video_url",
            "label": "Video URL",
            "accept": ["youtube", "vimeo"],
            "default": "https://www.youtube.com/watch?v=_9VUPq3SxOc",
            "info": "Insert Youtube URL",
            "placeholder": "text"
        }
    ]   
}
{% endschema %}

{%schema%}
{
“名称”:“嵌入Youtube”,
“设置”:[
{
“id”:“视频url”,
“类型”:“视频url”,
“标签”:“视频URL”,
“接受”:[“youtube”,“vimeo”],
“默认值”:https://www.youtube.com/watch?v=_9VUPq3SxOc",
“信息”:“插入Youtube URL”,
“占位符”:“文本”
}
]   
}
{%endschema%}
以下是我对该部分的代码放置:

<div >
    {% section 'EmbedYoutube' %}
</div>

{%节“%”

我认为您在对文档进行了一些搜索之后,就得到了答案,为了将来的参考,您可以像下面的代码一样添加动态数据

 <div style="padding-top:56.17021276595745%" id="w-node-cdda72edcacb-27a794fe" class="w-embed-youtubevideo">
<iframe src="https://www.youtube.com/embed/{{section.settings.video_url.id}}?rel=0&amp;controls=1&amp;autoplay=0&amp;mute=0&amp;start=0" frameborder="0" style="position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:auto" allow="autoplay; encrypted-media" allowfullscreen="">
          </iframe>
</div>
</div>
{% schema %}
  {
    "name": "Embed Youtube",
    "settings": [
    {
  "id": "video_url",
  "type": "video_url",
  "label": "Video URL",
  "accept": ["youtube", "vimeo"],
  "default": "https://www.youtube.com/watch?v=_9VUPq3SxOc",
  "info": "Insert Youtube URL",
  "placeholder": "text"
}
    ]
    
  }
{% endschema %}

{%schema%}
{
“名称”:“嵌入Youtube”,
“设置”:[
{
“id”:“视频url”,
“类型”:“视频url”,
“标签”:“视频URL”,
“接受”:[“youtube”,“vimeo”],
“默认值”:https://www.youtube.com/watch?v=_9VUPq3SxOc",
“信息”:“插入Youtube URL”,
“占位符”:“文本”
}
]
}
{%endschema%}

您可以在Shopify文档中查看更多有关
视频\u url
的信息

您好,我没有看到您对我的代码所做的更改。你能指出它们吗?此外,我不确定您建议我采取的方法。你能详细说明一下吗?