2017-01-26 8 views
0

私はTYPO3 7.6.13を使用しています。ニュース拡張をカスタマイズしようとしています。私は独自のカスタムテンプレートを挿入しようとしていますが、TYPO3はそれを見つけることができません。したがって、デフォルトテンプレートは常に含まれています。TYPO3 - 拡張テンプレートを正しく編集する

Configuration/TypoScriptディレクトリ内にsetup.txtファイルとconstants.txtファイルをカスタマイズしました。これは、セットアップの一部である fileadmin /テンプレート/内線/ニュース/テンプレート/ fileadmin /テンプレート/内線/ニュース/パーシャル/

私はまたfileadminディレクトリ内のテンプレートとパーシャルのためのカスタムディレクトリを作成しました。 txt:

plugin.tx_news { 
    mvc.callDefaultActionIfActionCantBeResolved = 1 
    view { 
     templateRootPaths { 
      0 = EXT:news/Resources/Private/Templates/ 
      1 = {$plugin.tx_news.view.templateRootPath} 

     } 
     partialRootPaths { 
      0 = EXT:news/Resources/Private/Partials 
      1 = {$plugin.tx_news.view.partialRootPath} 

     } 
     layoutRootPaths { 
      0 = EXT:news/Resources/Private/Layouts/ 
      1 = {$plugin.tx_news.view.layoutRootPath} 
     } 
widget.GeorgRinger\News\ViewHelpers\Widget\PaginateViewHelper.templateRootPath = EXT:news/Resources/Private/Templates/ 
    } 

fileadminの内部で作成したテンプレートとパーシャルのconstants.txtカスタムディレクトリを追加しました。以下はconstants.txtコードです:

plugin.tx_news { 
rss.channel { 
    title = Dummy Title 
    description = 
    link = http://example.com 
    language = en-gb 
    copyright = TYPO3 News 
    category = 
    generator = TYPO3 EXT:news 
} 

opengraph { 
    site_name = 

    twitter { 
     card = summary 
     site = 
     creator = 
    } 
} 

view { 
    # cat=plugin.tx_news/file; type=string; label=Path to template root (FE) 
    templateRootPath = fileadmin/templates/ext/news/templates/ 
    #templateRootPath.1 = EXT:news/Resources/Private/Templates/ 
    # cat=plugin.tx_news/file; type=string; label=Path to template partials (FE) 
    partialRootPath = fileadmin/templates/ext/news/partials/ 
    #partialRootPath.2 = EXT:news/Resources/Private/Partials/ 
    # cat=plugin.tx_news/file; type=string; label=Path to template layouts (FE) 
    layoutRootPath = EXT:news/Resources/Private/Layouts/ 
} 

settings { 
    # cat=plugin.tx_news/file; type=string; label=Path to CSS file 
    cssFile = EXT:news/Resources/Public/Css/news-basic.css 
} 

}

すべてのヘルプは大歓迎です! Denis

答えて

1

templateRootPathtemplateRootPathsをテンプレート(+部分+レイアウト)パターンの定義に混同しないでください!名前と用途が定数ファイルのように混在している場合は注意してください(コメントには、単数形に定義された配列項目がありますが、それは重要ではないコメントです)。

あなたが作っていない拡張機能。

これらの行がext:newsの静的テンプレートファイルのものである場合は、ファイルからのインクルードとしても独自のtyposcriptテンプレートを作成できますが、拡張子の後にインクルードします(またはテンプレートレコードにスタティックを含めます)。

一般的な設定を定義する拡張子が必要です。

あなたは拡張子の静的テンプレートに設定するあなたのTypoScriptテンプレートにあなた値を入力するために一定のエディタを使用する場合があります。

ここでは明確な定義があり、値を使用する必要があり、拡張が機能するはずです。

これ以外の場合は、TS設定の内線番号からTSを設定できます。特に、定数エディタで使用できない値を設定する場合は特に注意してください。したがって、どの値が拡張から評価されるのかを知る必要があります。マニュアルを見て!

関連する問題