第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

在 Sulu 模板中包含帶有 xpointer 的屬性

在 Sulu 模板中包含帶有 xpointer 的屬性

我已經(jīng)設(shè)置了一些 Sulu 模板,并且能夠使用此處描述的方法將整個(gè)文件的內(nèi)容包含在多個(gè)模板中:https://docs.sulu.io/en/2.1/book/templates.html我在用著:<xi:include href="fragments/common-properties.xml"/這很有效不過(guò),我隨后嘗試使用 xpointer 方法包含另一個(gè)模板中的屬性(以便我可以在一個(gè)文件中包含所有模板中的一堆通用屬性,另外還為各個(gè)模板定義特定屬性)我的根模板在這里:(root-page-test.xml)<?xml version="1.0" ?><template xmlns="http://schemas.sulu.io/template/template"          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"          xmlns:xi="http://www.w3.org/2001/XInclude"          xsi:schemaLocation="http://schemas.sulu.io/template/template http://schemas.sulu.io/template/template-1.0.xsd">    <key>my-account-page-react</key>    <view>pages/my-account-page-react</view>    <controller>App\Controller\Headless\HeadlessWebsiteController::indexAction</controller>    <cacheLifetime>604800</cacheLifetime>    <meta>        <title>Test including properties</title>    </meta>        <properties>        <property name="header" type="text_line">            <meta>                <title>Header</title>            </meta>        </property>        <xi:include href="include.xml"            xpointer="xmlns(sulu=http://schemas.sulu.io/template/template)                      xpointer(/sulu:properties/sulu:property)"/>    </properties>            </template>包含我想要包含的屬性的模板位于此處:(include.xml)<?xml version="1.0" ?><template xmlns="http://schemas.sulu.io/template/template"          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"          xmlns:xi="http://www.w3.org/2001/XInclude"          xsi:schemaLocation="http://schemas.sulu.io/template/template http://schemas.sulu.io/template/template-1.1.xsd">    <key>include-test</key>        <view>pages/my-account-page-react</view>    <controller>App\Controller\Headless\HeadlessWebsiteController::indexAction</controller>    <cacheLifetime>604800</cacheLifetime>        <meta>        <title>Test include</title>    </meta>兩個(gè)文件位于同一目錄中我哪里出錯(cuò)了?
查看完整描述

2 回答

?
慕俠2389804

TA貢獻(xiàn)1719條經(jīng)驗(yàn) 獲得超6個(gè)贊

您的 XPointer 不正確,因?yàn)槿绻?a 開頭,/則意味著您正在從文檔的根目錄開始。因此,如果您這樣做,/sulu:properties/sulu:propertyXPointer 會(huì)假定properties您嘗試包含的文件的根目錄應(yīng)該有一個(gè)標(biāo)簽。我的建議是您創(chuàng)建一個(gè)類似的文件(這也顯示在本標(biāo)題文檔中的最后一個(gè)代碼片段中):


<?xml version="1.0" ?>

<properties xmlns="http://schemas.sulu.io/template/template"

? ? ? ? ? ? xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

? ? ? ? ? ? xsi:schemaLocation="http://schemas.sulu.io/template/template http://schemas.sulu.io/template/template-1.1.xsd">

? ? <property name="url" type="resource_locator" mandatory="true">

? ? ? ? <meta>

? ? ? ? ? ? <title>Resourcelocator</title>

? ? ? ? </meta>


? ? ? ? <tag name="sulu.rlp"/>

? ? </property>

? ? ? ??

? ? <property name="title" type="text_line" mandatory="true">?

? ? ? ? <meta>

? ? ? ? ? ? <title>Title</title>?

? ? ? ? </meta>

? ? ? ? <params>

? ? ? ? ? ?<param name="headline" value="true"/>?

? ? ? ? </params>

? ? ? ? <tag name="sulu.rlp.part"/>

? ? </property>


? ? <property name="article" type="text_editor">

? ? ? ? <meta>

? ? ? ? ? ? <title>Article</title>

? ? ? ? </meta>

? ? </property>

</properties>

通過(guò)這種方式,您還可以刪除不必要的元素,例如view和controller標(biāo)簽,在本例中不需要這些元素。


或者,您也可以調(diào)整包含的 XPointer:


<xi:include href="include.xml" xpointer="xmlns(sulu=http://schemas.sulu.io/template/template)xpointer(/sulu:template/sulu:properties/sulu:property)" />

sulu:template注意xpointer 開頭的附加內(nèi)容。


查看完整回答
反對(duì) 回復(fù) 2023-10-15
?
動(dòng)漫人物

TA貢獻(xiàn)1815條經(jīng)驗(yàn) 獲得超10個(gè)贊

我有同樣的錯(cuò)誤消息。但就我而言,這是 xpointer 定義中的語(yǔ)法錯(cuò)誤。我寫


<xi:include

   href="default.xml"

   xpointer="xmlns(sulu=http://schemas.sulu.io/template/template)

             xpointer(/sulu:template/sulu:properties/sulu:property"/>

<!-- _____________________________________________________________^ -->

不知何故,我忘記了 xpointer 屬性末尾的右括號(hào)。


查看完整回答
反對(duì) 回復(fù) 2023-10-15
  • 2 回答
  • 0 關(guān)注
  • 121 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)