[Frage] tx_news verschiedene Bildgrößen TYPO3-Version: 4.7.12

  • JaegerAi JaegerAi
    Typ im Roten Hemd
    0 x
    3 Beiträge
    0 Hilfreiche Beiträge
    14. 11. 2013, 11:22

    Hallo Liebe Community,

    wie kann ich ein Dropdown Feld(Bildgrößen) in die Bearbeitsungsoberfläche "News erstellen" einfügen und den ausgewählten Wert im News Template aufrufen.

    Vielen Dank im Voraus

    Daten:

    Typo3 Version: 4.7.15
    News(Georg Ringer) Version: 2.2.1


  • 1
  • just2b just2b
    TYPO3-Yoda
    0 x
    18741 Beiträge
    2 Hilfreiche Beiträge
    21. 11. 2013, 18:12

    Hallo,

    das hat mit der extension eigentlich nix zu tun.

    du musst einfach nur von tx_news_domain_model_media im TCA die configuration ändern dass das kein typ text mehr ist sondern eben eine liste

  • JaegerAi JaegerAi
    Typ im Roten Hemd
    0 x
    3 Beiträge
    0 Hilfreiche Beiträge
    22. 11. 2013, 13:00

    Hallo,

    kannst du mir mal ein beispiel geben, ich verseth nicht ganz was du meinst.

  • just2b just2b
    TYPO3-Yoda
    0 x
    18741 Beiträge
    2 Hilfreiche Beiträge
    22. 11. 2013, 14:05

    siehe zB http://jweiland.net/typo3/konfiguration/change-configuration.html

  • JaegerAi JaegerAi
    Typ im Roten Hemd
    0 x
    3 Beiträge
    0 Hilfreiche Beiträge
    22. 11. 2013, 14:13

    Hallo,

    das mit dem Dropdwon hab ich hinbekommen.
    Nur wie bekomme ich den Wert nun in das Template?

    Das ist der Dazugehörige Code in dem Ordner TCA von der Extendion tx_news

    Im Anhang auch ein Bild wie es aussieht.

    1. <?php
    2. if (!defined('TYPO3_MODE')) {
    3. die ('Access denied.');
    4. }
    5.  
    6. $ll = 'LLL:EXT:news/Resources/Private/Language/locallang_db.xml:';
    7.  
    8.  
    9. // Extension manager configuration
    10. $configuration = Tx_News_Utility_EmConfiguration::getSettings();
    11.  
    12. $TCA['tx_news_domain_model_media'] = array(
    13. 'ctrl' => $TCA['tx_news_domain_model_media']['ctrl'],
    14. 'interface' => array(
    15. 'showRecordFieldList' => 'sys_language_uid,l10n_parent,l10n_diffsource,hidden,title,media,type,video,showInPreview, width, height, description'
    16. ),
    17. 'feInterface' => $TCA['tx_news_domain_model_media']['feInterface'],
    18. 'columns' => array(
    19. 'pid' => array(
    20. 'label' => 'pid',
    21. 'config' => array(
    22. 'type' => 'passthrough'
    23. )
    24. ),
    25. 'sorting' => array(
    26. 'label' => 'pid',
    27. 'config' => array(
    28. 'type' => 'passthrough'
    29. )
    30. ),
    31. 'crdate' => array(
    32. 'label' => 'crdate',
    33. 'config' => array(
    34. 'type' => 'passthrough',
    35. )
    36. ),
    37. 'tstamp' => array(
    38. 'label' => 'tstamp',
    39. 'config' => array(
    40. 'type' => 'passthrough',
    41. )
    42. ),
    43. 'sys_language_uid' => array(
    44. 'exclude' => 1,
    45. 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.language',
    46. 'config' => array(
    47. 'type' => 'select',
    48. 'foreign_table' => 'sys_language',
    49. 'foreign_table_where' => 'ORDER BY sys_language.title',
    50. 'items' => array(
    51. array('LLL:EXT:lang/locallang_general.xml:LGL.allLanguages', -1),
    52. array('LLL:EXT:lang/locallang_general.xml:LGL.default_value', 0)
    53. )
    54. )
    55. ),
    56. 'l10n_parent' => array(
    57. 'displayCond' => 'FIELD:sys_language_uid:>:0',
    58. 'exclude' => 1,
    59. 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.l18n_parent',
    60. 'config' => array(
    61. 'type' => 'select',
    62. 'items' => array(
    63. array('', 0),
    64. ),
    65. 'foreign_table' => 'tx_news_domain_model_media',
    66. 'foreign_table_where' => 'AND tx_news_domain_model_media.pid=###CURRENT_PID### AND tx_news_domain_model_media.sys_language_uid IN (-1,0)',
    67. )
    68. ),
    69. 'l10n_diffsource' => array(
    70. 'config' => array(
    71. 'type' => 'passthrough'
    72. )
    73. ),
    74. 'hidden' => array(
    75. 'exclude' => 1,
    76. 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden',
    77. 'config' => array(
    78. 'type' => 'check',
    79. 'default' => 0
    80. )
    81. ),
    82. 'caption' => array(
    83. 'exclude' => 1,
    84. 'l10n_mode' => 'noCopy',
    85. 'label' => $ll . 'tx_news_domain_model_media.caption',
    86. 'config' => array(
    87. 'type' => 'input',
    88. 'size' => 30,
    89. )
    90. ),
    91. 'title' => array(
    92. 'exclude' => 1,
    93. 'l10n_mode' => 'noCopy',
    94. 'label' => 'LLL:EXT:cms/locallang_ttc.xml:image_titleText',
    95. 'config' => array(
    96. 'type' => 'input',
    97. 'size' => 20,
    98. )
    99. ),
    100. 'alt' => array(
    101. 'exclude' => 1,
    102. 'l10n_mode' => 'noCopy',
    103. 'label' => 'LLL:EXT:cms/locallang_ttc.xml:image_altText',
    104. 'config' => array(
    105. 'type' => 'input',
    106. 'size' => 20,
    107. )
    108. ),
    109. 'image' => array(
    110. 'exclude' => 0,
    111. 'l10n_mode' => 'copy',
    112. 'label' => $ll . 'tx_news_domain_model_media.media',
    113. 'config' => array(
    114. 'type' => 'group',
    115. 'internal_type' => 'file',
    116. 'allowed' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'],
    117. 'max_size' => $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize'],
    118. 'uploadfolder' => 'uploads/tx_news',
    119. 'show_thumbs' => 1,
    120. 'size' => 1,
    121. 'minitems' => 1,
    122. 'maxitems' => 1,
    123. )
    124. ),
    125. 'multimedia' => array(
    126. 'exclude' => 0,
    127. 'l10n_mode' => 'copy',
    128. 'label' => $ll . 'tx_news_domain_model_media.multimedia',
    129. 'config' => array(
    130. 'type' => 'input',
    131. 'size' => 30,
    132. 'eval' => 'trim,required',
    133. 'softref' => 'news_externalurl',
    134. 'wizards' => array(
    135. '_PADDING' => 2,
    136. 'link' => array(
    137. 'type' => 'popup',
    138. 'title' => 'Link',
    139. 'icon' => 'link_popup.gif',
    140. 'script' => 'browse_links.php?mode=wizard',
    141. 'JSopenParams' => 'height=300,width=500,status=0,menubar=0,scrollbars=1'
    142. )
    143. )
    144. )
    145. ),
    146. 'dam' => array(
    147. 'exclude' => 0,
    148. 'l10n_mode' => 'mergeIfNotBlank',
    149. 'label' => $ll . 'tx_news_domain_model_media.dam',
    150. 'config' => array(
    151. 'form_type' => 'user',
    152. 'userFunc' => 'EXT:dam/lib/class.tx_dam_tcefunc.php:&tx_dam_tceFunc->getSingleField_typeMedia',
    153. 'userProcessClass' => 'EXT:mmforeign/class.tx_mmforeign_tce.php:tx_mmforeign_tce',
    154. 'type' => 'group',
    155. 'internal_type' => 'db',
    156. 'allowed' => 'tx_dam',
    157. 'prepend_tname' => 1,
    158. 'foreign_table' => 'tx_dam',
    159. 'MM' => 'tx_dam_mm_ref',
    160. 'MM_opposite_field' => 'file_usage',
    161. 'MM_match_fields' => array(
    162. 'ident' => 'tx_news_media'
    163. ),
    164. 'allowed_types' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'],
    165.  
    166. 'max_size' => 1,
    167. 'show_thumbs' => 1,
    168. 'size' => 1,
    169. 'maxitems' => 1,
    170. 'minitems' => 1,
    171. 'autoSizeMax' => 1,
    172. )
    173. ),
    174. 'showinpreview' => array(
    175. 'exclude' => 1,
    176. 'label' => $ll . 'tx_news_domain_model_media.showinpreview',
    177. 'config' => array(
    178. 'type' => 'check',
    179. 'default' => 0
    180. )
    181. ),
    182. 'type' => array(
    183. 'exclude' => 1,
    184. 'l10n_mode' => 'mergeIfNotBlank',
    185. 'label' => 'LLL:EXT:cms/locallang_ttc.xml:media.type',
    186. 'config' => array(
    187. 'type' => 'select',
    188. 'itemsProcFunc' => 'Tx_News_Hooks_ItemsProcFunc->user_MediaType',
    189. 'items' => array(
    190. array($ll . 'tx_news_domain_model_media.type.I.0', '0', t3lib_extMgm::extRelPath('news') . 'Resources/Public/Icons/media_type_image.png'),
    191. array($ll . 'tx_news_domain_model_media.type.I.1', '1', t3lib_extMgm::extRelPath('news') . 'Resources/Public/Icons/media_type_multimedia.png'),
    192. ),
    193. 'size' => 1,
    194. 'maxitems' => 1,
    195. )
    196. ),
    197. 'width' => array(
    198. 'exclude' => 1,
    199. 'l10n_mode' => 'mergeIfNotBlank',
    200. 'label' => 'LLL:EXT:cms/locallang_ttc.xml:imagewidth_formlabel',
    201. 'config' => array(
    202. 'type' => 'select',
    203. 'items' => array(
    204. array('100'),
    205. array('100')
    206. )
    207. )
    208. ),
    209. 'height' => array(
    210. 'exclude' => 1,
    211. 'l10n_mode' => 'mergeIfNotBlank',
    212. 'label' => 'LLL:EXT:cms/locallang_ttc.xml:imageheight_formlabel',
    213. 'config' => array(
    214. 'type' => 'input',
    215. 'size' => 3,
    216. 'eval' => 'int',
    217. )
    218. ),
    219. 'copyright' => array(
    220. 'exclude' => 1,
    221. 'l10n_mode' => 'mergeIfNotBlank',
    222. 'label' => $ll . 'tx_news_domain_model_media.copyright',
    223. 'config' => array(
    224. 'type' => 'input',
    225. 'size' => 20,
    226. )
    227. ),
    228. 'description' => array(
    229. 'exclude' => 0,
    230. 'l10n_mode' => 'noCopy',
    231. 'label' => $ll .'tx_news_domain_model_file.description',
    232. 'config' => array(
    233. 'type' => 'text',
    234. 'cols' => 30,
    235. 'rows' => 5,
    236. 'wizards' => array(
    237. '_PADDING' => 2,
    238. 'RTE' => array(
    239. 'notNewRecords' => 1,
    240. 'RTEonly' => 1,
    241. 'type' => 'script',
    242. 'title' => 'Full screen Rich Text Editing',
    243. 'icon' => 'wizard_rte2.gif',
    244. 'script' => 'wizard_rte.php',
    245. ),
    246. ),
    247. )
    248. ),
    249. ),
    250. 'types' => array(
    251. // Image
    252. '0' => array('showitem' => 'type;;palettteCore,image;;paletteWidthHeight,caption,title;;paletteAlt,copyright,description;;;richtext::rte_transform[flag=rte_disabled|mode=ts_css],'),
    253. // Multimedia (Video & Audio)
    254. '1' => array('showitem' => 'type;;palettteCore,multimedia,caption,copyright,description,'),
    255. // DAM
    256. '3' => array('showitem' => 'type;;palettteCore,dam,caption,title;;paletteAlt,copyright,')
    257. ),
    258. 'palettes' => array(
    259. 'paletteWidthHeight' => array(
    260. 'showitem' => 'width,height,',
    261. 'canNotCollapse' => TRUE
    262. ),
    263. 'palettteCore' => array(
    264. 'showitem' => 'showinpreview, hidden,sys_language_uid;;;;1-1-1, l10n_parent, l10n_diffsource,',
    265. 'canNotCollapse' => TRUE
    266. ),
    267. 'paletteAlt' => array(
    268. 'showitem' => 'alt',
    269. 'canNotCollapse' => FALSE
    270. ),
    271. )
    272. );
    273.  
    274. // Hide DAM field if not used to avoid errors
    275. if (!t3lib_extMgm::isLoaded('dam')) {
    276. unset($TCA['tx_news_domain_model_media']['columns']['dam']);
    277. }
    278.  
    279. // Hide RTE description field
    280. if (!$configuration->getShowMediaDescriptionField()) {
    281. unset($TCA['tx_news_domain_model_media']['columns']['description']);
    282. }
    283.  
    284. ?>

    Anhänge (1)
    dropdown.jpg image/jpeg 0,00 B 342 heruntergeladen
  • 1