2017-01-15 6 views
0

イメージをレンダリングするだけのカスタム要素が必要です。 カスタム拡張を作成しました。Typoscriptカスタムコンテンツテンプレートのメディアイメージを取得

これは私が得たものである:私が得る作品

ext_tables.php

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(' 
mod.wizards.newContentElement.wizardItems.common.elements { 
    cce_teaser { 
     icon = EXT:core/Resources/Public/Icons/T3Icons/content/content-image.svg 
     title = Produkt Bild 
     description = Hauptbild auf der Produktseite 
     tt_content_defValues.CType = product_image 
    } 
} 
mod.wizards.newContentElement.wizardItems.common.show := addToList(cce_teaser) 
'); 

$TCA['tt_content']['columns']['CType']['config']['items'][] = 
    array(
    'Custom Content Elements', 
    '--div--' 
); 

$TCA['tt_content']['columns']['CType']['config']['items'][] = 
    array(
    'Hauptbild auf der Produktseite', 
    'product_image', 
     \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY) . 'ext_icon.gif' 
); 

$TCA['tt_content']['types']['product_image']['showitem'] = ' 
    --palette--;LLL:EXT:cms/locallang_ttc.xml:palette.general;general, 
    --palette--;LLL:EXT:cms/locallang_ttc.xml:palette.header;header, 
    --div--;Text, 
    bodytext;Text;;richtext:rte_transform[flag=rte_enabled|mode=ts_css], rte_enabled;LLL:EXT:cms/locallang_ttc.xml:rte_enabled_formlabel, 
    --div--;Bilder, 
    image, 
    --div--;LLL:EXT:cms/locallang_ttc.xml:tabs.access, 
    --palette--;LLL:EXT:cms/locallang_ttc.xml:palette.visibility;visibility, 
    --palette--;LLL:EXT:cms/locallang_ttc.xml:palette.access;access, 
'; 

Custom Image Element in Backend

2000_product_page.t3s

tt_content.product_image = COA 
tt_content.product_image { 
    10 = FLUIDTEMPLATE 
    10 { 
    file = {$resDir}/Private/Templates/ProductDetailImage.html 
    partialRootPath = {$resDir}/Private/Partials 
    layoutRootPath = {$resDir}/Private/Layouts 
    } 
} 

ProductDetailImage.html

<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:ce="http://typo3.org/ns/TYPO3/CMS/FluidStyledContent/ViewHelpers" data-namespace-typo3-fluid="true"> 
<h1>Test</h1> 

<f:debug>{data}</f:debug> 
<!-- HOW CAN I GET THE IMAGE INFORMATIONS? SRC, TITLE, WITH, HEIGHT ... --> 

</html> 

テンプレートProductDetailImage.htmlがレンダリングされますが、私はどのように画像データを取得する見当もつかない。 誰かが何をしなければならないか知っていますか? Plsヘルプ!

ありがとうございました!

答えて

0

FALを使用してイメージのアップロードフィールドが正しく設定されている場合、TYPO3 7.6ではFLUIDTEMPLATEのプロセッサを使用できます。画像データを取得するには、ViewHelperまたはそれらのプロセッサを使用します。ここでFilesProcessorを確認してください:https://docs.typo3.org/typo3cms/TyposcriptReference/ContentObjects/Fluidtemplate/Index.html

+0

あなたの答えは、ポール! 「FALを使用して画像アップロードフィールドが正しく設定されている場合」 簡単な例ができますか? – Grauzone

+0

ContentObject内に「ファイルのアップロード/選択」フィールドがありますか? あなたのTCAは "image"フィールドを表示するように設定されていますが、フィールドがまだTYPO3に存在するか、名前が変更されているかはわかりませんが、それで結構 –

+0

うん、そのすべてが正しい、私は唯一のヒントを必要とする – Grauzone

関連する問題