簡體   English   中英

TYPO3 Neos:應用內容屬性在JavaScript中運行錯誤

[英]TYPO3 Neos: Apply content property run in JavaScript error

我嘗試創建像多列這樣的自定義節點類型,並且默認ContentCollection應該使用ContentCollection屬性擴展。 到目前為止,后端和前端視圖都可以使用。 但是,如果更改了ContentCollection的屬性span ,則編輯器將在JavaScript超時錯誤中運行。 控制台中沒有錯誤或警告。

錯誤信息:

警告:不回答腳本

Ein Skript auf dieer Seite ist eventuellbeschäftigtoder es antwortet nicht mehr。 Siekönnendas Skript jetpen即時消息,調試器öffnenoder weiterausführen。

Skript: http ://domain.com/_Resources/Static/Packages/TYPO3.Neos/JavaScript/ContentModule-built.js:389

要重現,請執行以下操作:

使用站點包“ TYPO3.NeosDemoTypo3Org”。 TYPO3 Neos v1.1.2。 創建一個包“ Selector.Test”

Configuration / Settings.yaml

TYPO3:
  Neos:

    typoScript:
      autoInclude:
        'Selector.Test': TRUE

    nodeTypes:
      groups:
        selectorTest:
          label: 'Selector Test'
          position: 10

Configuration / NodeTypes.Columns.yaml

'Selector.Test:RowAbstract':
  abstract: TRUE
  superTypes:
    - 'TYPO3.Neos:Content'
  ui:
    label: 'Columns'
    group: 'selectorTest'
    icon: 'icon-columns'
    inlineEditable: TRUE
    inspector:
      groups:
        columnSettings:
          label: 'Column settings'
          position: 10

# Create a custom ContentCollection
'Selector.Test:ColumnContentCollection':
  superTypes:
    - 'TYPO3.Neos:ContentCollection'
  ui:
    label: 'Column Content Collection'
    icon: 'icon-list'
    inlineEditable: TRUE
    inspector:
      groups:
        columnSpan:
          label: 'Column span'
          position: 10
  properties:
    span:
      type: string
      defaultValue: ''
      ui:
        label: 'Span'
        reloadIfChanged: TRUE
        inspector:
          group: 'columnSpan'

# Define row with custom ContentCollection
'Selector.Test:Row':
  superTypes:
    - 'Selector.Test:RowAbstract'
  childNodes:
    column0:
      type: 'Selector.Test:ColumnContentCollection'
    column1:
      type: 'Selector.Test:ColumnContentCollection'

資源/私人/TypoScript/Root.ts2

prototype(Selector.Test:Row) < prototype(TYPO3.Neos:Content) {

    templatePath = 'resource://Selector.Test/Private/Templates/NodeTypes/Row.html'

    attributes {
        class = 'row'
    }

    columns = TYPO3.TypoScript:Collection {
        collection = ${q(node).children('[instanceof TYPO3.Neos:ContentCollection]')}
        itemRenderer = Selector.Test:Column
        itemName = 'node'
    }
}

prototype(Selector.Test:Column) < prototype(TYPO3.TypoScript:Template) {

    node = ${node}
    templatePath = 'resource://Selector.Test/Private/Templates/NodeTypes/Column.html'

    attributes = TYPO3.TypoScript:Attributes {
        class.span = ${q(node).property('span') ? q(node).property('span') : null}
    }

    columnContentCollection = TYPO3.Neos:ContentCollection {
        nodePath = '.'
    }
}

資源/私人/模板/NodeTypes/Column.html

{namespace ts=TYPO3\TypoScript\ViewHelpers}
<div{attributes -> f:format.raw()}>
    <ts:render path="columnContentCollection" />
</div>

資源/私人/模板/NodeTypes/Row.html

{namespace ts=TYPO3\TypoScript\ViewHelpers}
<div{attributes -> f:format.raw()}>
    <ts:render path="columns" />
</div>

這似乎是此Jira問題中描述的問題 不幸的是,它尚未解決,但是存在一個初步的解決方案,可以作為公開更改(供審查): https : //review.typo3.org/#/c/31244/

您可以嘗試將該更改應用到TYPO3.Neos軟件包中,如果解決了問題,則可以提供反饋,因此可以將其合並到下一個Neos版本中。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM