Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.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
Seo 在AEM中,我想添加<;斯莱></斯莱>;a中的标签<;脚本></脚本>;标签。模式内的多字段选项_Seo_Aem_Json Ld_Sightly - Fatal编程技术网

Seo 在AEM中,我想添加<;斯莱></斯莱>;a中的标签<;脚本></脚本>;标签。模式内的多字段选项

Seo 在AEM中,我想添加<;斯莱></斯莱>;a中的标签<;脚本></脚本>;标签。模式内的多字段选项,seo,aem,json-ld,sightly,Seo,Aem,Json Ld,Sightly,因此,我正在构建一个多字段创作选项。如果需要,发布者可以添加值和创建更多文本字段。但问题是在标记中添加标记会给我带来问题。例如: <sly data-sly-use.FAQschemaObject="${'../../../clientlibs/clientlib-base/js/collection/multi-collection.js' @ resourcePath = resource.path , multifieldName='FAQschemas'}"&g

因此,我正在构建一个多字段创作选项。如果需要,发布者可以添加值和创建更多文本字段。但问题是在
标记中添加
标记会给我带来问题。例如:

<sly data-sly-use.FAQschemaObject="${'../../../clientlibs/clientlib-base/js/collection/multi-collection.js' @ resourcePath = resource.path , multifieldName='FAQschemas'}"> </sly>

    <script type="application/ld+json">
<sly data-sly-list.FAQschema="${FAQschemaObject}" data-sly-unwrap>
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [{
"@type": "Question",
"name": "${FAQschema.properties.question @ context = "html"}",
"acceptedAnswer": {
"@type": "Answer",
"text": "${FAQschema.properties.answer @ context = "html"}"
}
}]
            }
</script>
</sly>

{
“@context”:”https://schema.org",
“@type”:“常见问题解答页面”,
“主要实体”:[{
“@type”:“问题”,
“名称”:“${FAQschema.properties.question@context=“html”}”,
“接受回答”:{
“@type”:“Answer”,
“text”:“${FAQschema.properties.answer@context=“html”}”
}
}]
}
如您所见,我只想在填充值时显示此脚本。如果作者愿意,还可以选择添加更多问题和答案值。我正在尝试实现谷歌提供的FAQ模式

因此,我想实现一些类似谷歌的例子:

<script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "FAQPage",
      "mainEntity": [{
        "@type": "Question",
        "name": "What is the return policy?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "Most unopened items in new condition and returned within <strong>90 days</strong> will receive a refund or exchange. Some items have a modified return policy noted on the receipt or packing slip. Items that are opened or damaged or do not have a receipt may be denied a refund or exchange. Items purchased online or in-store may be returned to any store.<br /><p>Online purchases may be returned via a major parcel carrier. <a href=http://example.com/returns> Click here </a> to initiate a return.</p>"
        }
      }, {
        "@type": "Question",
        "name": "How long does it take to process a refund?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "We will reimburse you for returned items in the same way you paid for them. For example, any amounts deducted from a gift card will be credited back to a gift card. For returns by mail, once we receive your return, we will process it within 4–5 business days. It may take up to 7 days after we process the return to reflect in your account, depending on your financial institution's processing time."
        }
      }, {
        "@type": "Question",
        "name": "What is the policy for late/non-delivery of items ordered online?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "Our local teams work diligently to make sure that your order arrives on time, within our normaldelivery hours of 9AM to 8PM in the recipient's time zone. During  busy holiday periods like Christmas, Valentine's and Mother's Day, we may extend our delivery hours before 9AM and after 8PM to ensure that all gifts are delivered on time. If for any reason your gift does not arrive on time, our dedicated Customer Service agents will do everything they can to help successfully resolve your issue. <br/> <p><a href=https://example.com/orders/>Click here</a> to complete the form with your order-related question(s).</p>"
        }
      }, {
        "@type": "Question",
        "name": "When will my credit card be charged?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "We'll attempt to securely charge your credit card at the point of purchase online. If there's a problem, you'll be notified on the spot and prompted to use another card. Once we receive verification of sufficient funds, your payment will be completed and transferred securely to us. Your account will be charged in 24 to 48 hours."
        }
      }, {
        "@type": "Question",
        "name": "Will I be charged sales tax for online orders?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text":"Local and State sales tax will be collected if your recipient's mailing address is in: <ul><li>Arizona</li><li>California</li><li>Colorado</li></ul>"}
        }]
    }
    </script>

{
“@context”:”https://schema.org",
“@type”:“常见问题解答页面”,
“主要实体”:[{
“@type”:“问题”,
“名称”:“退货政策是什么?”,
“接受回答”:{
“@type”:“Answer”,
“文本”:"大多数处于新状态且在90天内退回的未开封商品将收到退款或换货。一些商品在收据或装箱单上注明了修改后的退货政策。打开或损坏或没有收据的商品可能会被拒绝退款或换货。在线或在商店购买的商品可能会退回给任何供应商撕毁。
在线购买的物品可以通过主要包裹承运人退回。若要发起退回,请执行以下操作。

“ } }, { “@type”:“问题”, “姓名”:“办理退款需要多长时间?”, “接受回答”:{ “@type”:“Answer”, “文本”:我们将按照您为退货支付的相同方式向您报销退货。例如,从礼品卡中扣除的任何金额都将贷记回礼品卡。对于邮寄退货,一旦我们收到您的退货,我们将在4-5个工作日内处理。我们处理退货后可能需要7天才能反映在您的帐户中,具体取决于根据您的金融机构的处理时间进行调整。” } }, { “@type”:“问题”, “名称”:“网上订购物品延迟/未交付的政策是什么?”, “接受回答”:{ “@type”:“Answer”, “文本”:我们当地的团队努力工作,确保您的订单在收件人所在时区上午9点到晚上8点的正常发货时间内准时到达。在圣诞节、情人节和母亲节等繁忙的节日期间,我们可能会延长上午9点之前和晚上8点之后的发货时间,以确保所有礼物都能按时送达。如果出于任何原因,我们会如果您的礼物未能按时送达,我们专门的客户服务代理将竭尽所能帮助您成功解决问题。
请填写表格,并填写您的订单相关问题。

“ } }, { “@type”:“问题”, “姓名”:“我的信用卡什么时候收费?”, “接受回答”:{ “@type”:“Answer”, “文本”:“我们将尝试在网上购买时安全地为您的信用卡充值。如果出现问题,将立即通知您并提示您使用另一张卡。一旦我们收到足够资金的验证,您的付款将完成并安全地转移到我们。您的帐户将在24到48小时内收费。” } }, { “@type”:“问题”, “名称”:“网上订单会向我征收销售税吗?”, “接受回答”:{ “@type”:“Answer”, “文本”:“如果收件人的邮寄地址位于:亚利桑那州加利福尼亚州科罗拉多州,则将征收当地和州销售税。” }] }

作者可以通过添加新值来创建新字段,但要保持以下结构。有没有可用的示例?

解决方法是将脚本标记中所需的所有代码放在自己的HTML文件中,并将其包含在脚本标记中。这样,应该可以很好地进行处理

<script data-sly-include='read-multifield-partial.html'></script>

在一个Sling模型中创建这个JSON,或者使用JS,直接将它转储到sightly中,而不是在sightly中循环并构建它