[!!!][FEATURE] Streamline Fluid Styled Content and CSS Styled Content
[Packages/TYPO3.CMS.git] / typo3 / sysext / css_styled_content / Configuration / TypoScript / ContentElement / Uploads.txt
1 # File Links:
2 # Makes a list of files for download.
3 #
4 # CType: uploads
5
6 tt_content.uploads = COA
7 tt_content.uploads {
8     10 = < lib.stdheader
9     20 = FILES
10     20 {
11         # get from file references:
12         references {
13             table = tt_content
14             fieldName = media
15         }
16         collections.field = file_collections
17         # get from path (backwards compatibility, contains strings like "fileadmin/user_uploads/")
18         folders.field = select_key
19         sorting.field = filelink_sorting
20         # render the files
21         renderObj = COA
22         renderObj {
23             10 = IMAGE
24             10 {
25                 file.import.data = file:current:originalUid // file:current:uid
26                 file.width = 150
27                 stdWrap {
28                     if {
29                         value = 2
30                         equals.field = uploads_type
31                     }
32                     typolink {
33                         parameter.data = file:current:originalUid // file:current:uid
34                         parameter.wrap = file:|
35                         fileTarget < lib.parseTarget
36                         fileTarget =
37                         fileTarget.override = {$styles.content.uploads.target}
38                         fileTarget.override.override.field = target
39                         removePrependedNumbers = 1
40
41                         title {
42                             data = file:current:title
43                             htmlSpecialChars = 1
44                         }
45                         /*
46                         jumpurl = {$styles.content.uploads.jumpurl}
47                         jumpurl {
48                             secure = {$styles.content.uploads.jumpurl_secure}
49                             secure.mimeTypes = {$styles.content.uploads.jumpurl_secure_mimeTypes}
50                         }
51                         */
52                     }
53                 }
54             }
55             # icon
56             15 = IMAGE
57             15 {
58                 file.import.data = file:current:extension
59                 file.import.case = lower
60                 file.import.dataWrap = {path:EXT:frontend/Resources/Public/Icons/FileIcons/}|.gif
61                 stdWrap {
62                     if {
63                         value = 1,2
64                         isInList.field = uploads_type
65                         # only show the icon if we don't have a thumbnail:
66                         isFalse.cObject = IMG_RESOURCE
67                         isFalse.cObject.file < tt_content.uploads.20.renderObj.10.file
68                         isFalse.cObject.stdWrap.if < tt_content.uploads.20.renderObj.10.stdWrap.if
69                     }
70                     typolink < tt_content.uploads.20.renderObj.10.stdWrap.typolink
71                 }
72             }
73             # filename
74             20 = TEXT
75             20 {
76                 data = file:current:title // file:current:name
77                 htmlSpecialChars = 1
78                 required = 1
79                 replacement {
80                     # equivalent to former useSpacesInLinkText = 0; remove using > to disable it
81                     10 {
82                         search = _
83                         replace.char = 32
84                     }
85                     # equivalent to former stripFileExtensionFromLinkText = 0; move "_20" to "20" to enable it. Disabled by default.
86                     _20 {
87                         search = /(.*)(\..*)/
88                         replace = \1
89                         useRegExp = 1
90                     }
91                 }
92                 typolink < tt_content.uploads.20.renderObj.10.stdWrap.typolink
93                 wrap = <span class="ce-uploads-fileName">|</span>
94             }
95             # description
96             30 = TEXT
97             30 {
98                 if.isTrue.field = uploads_description
99                 data = file:current:description
100                 htmlSpecialChars = 1
101                 wrap = <span class="ce-uploads-description">|</span>
102                 required = 1
103             }
104             # file size
105             40 = TEXT
106             40 {
107                 if.isTrue.field = filelink_size
108                 data = file:current:size
109                 wrap = <span class="ce-uploads-filesize">|</span>
110                 bytes = 1
111                 bytes.labels = {$styles.content.uploads.filesizeBytesLabels}
112             }
113             # wrap of each listed file with odd/even class
114             wrap.cObject = COA
115             wrap.cObject {
116                 10 = LOAD_REGISTER
117                 10 {
118                     elementClass = ce-uploads-element ce-uploads-element-{file:current:extension}
119                     elementClass.insertData = 1
120                 }
121                 20 = TEXT
122                 20 {
123                     value = <li class="{register:elementClass}">|</li>
124                     insertData = 1
125                 }
126                 30 = RESTORE_REGISTER
127             }
128         }
129         # wrap around whole content element with <ul> and editIcons
130         stdWrap {
131             editIcons = tt_content: media, filelink_size, uploads_description, uploads_type
132             editIcons.iconTitle.data = LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:eIcon.filelist
133             prefixComment = 2 | Filelist:
134             dataWrap = <ul class="ce-uploads">|</ul>
135         }
136     }
137 }