If you want to take part in the development, you need an account for the forge plattform. Then you can ask for a membership in the team and get access to the SVN repository.
The extension (tx_damfrontend_pi1) is written with a mvc pattern:
Model: All files in the subfolder “DAL”
View: The three classes in the subfolder “frontend”
Controller: The class tx_damfrontend_pi1 and also the connection to typo3
Hooks
Currently we offer one hook:
pushfile_sendFile: Whenever a file is downloaded
if you need a hook, please contact us.
DAM Frontend
The default typoscript can be found in the folder /static. If you want to use the typoscript directly in your own template, don't include the static template, but copy the typoscript code from the two files (static.txt and constant.txt) into your own template. Take care that all properties are used in your script. In later versions we want to improve the use of typoscript.
Constants
Property: | Data type: | Description: | Default: |
|---|---|---|---|
templateFile | string | Name of the function which is used to display the plugin | tx_damfrontend_pi1->main |
singleID | string | Path & filename to html template. Defined via a constant by default. Can be set by the constant editor. | {$plugin.tx_damfrontend_pi1.templateFile} |
errorWrap | String / integer | {$plugin.tx_damfrontend_pi1.singleID} | |
browsePointerWrap | String | errorWrap Example: filter { errorWrap ={$plugin.tx_damfrontend_pi1.filter.errorWrap} } | {$plugin.tx_damfrontend_pi1.filter.errorWrap} |
doNotUsePushFile | integer | to switch between using pushfile and direct link. | 0 |
mediafolder | integer | Page ID of the mediafolder (dam) | |
renderCategoryTree.iconPath | String / path | Path for the icons | EXT:dam_frontend/res/ico/tree/ |
newUntilSeconds | integer | define how many seconds to mark a file as new since crdate (86400 = 60*60*24 = 1 day) | 86400 |
Setup
Property: | Data type: | Description: | Default: |
|---|---|---|---|
userFunc | string | Name of the function which is used to display the plugin | tx_damfrontend_pi1->main |
templateFile | string | Path & filename to html template. Defined via a constant by default. Can be set by the constant editor. | {$plugin.tx_damfrontend_pi1.templateFile} |
IconBaseAddress | string/path | Path to the file icons (like pdf, doc, jpg,..). | dam_frontend/res/ico/ |
singleID | integer | ID of the page, which contains a single view content element to display file details. If not set, the current page is used. | {$plugin.tx_damfrontend_pi1.singleID} |
allowedLanguages | String/comma separated | Defines which languages are displayed in the language selector in the searchbox | |
filter | String | errorWrap Example: filter { errorWrap ={$plugin.tx_damfrontend_pi1.filter.errorWrap} } | {$plugin.tx_damfrontend_pi1.filter.errorWrap} |
UseAdvancedCategoryTree | Boolean | Defines if the advanced category tree is used | |
useTreeAndSelection | Boolean | If 1 a AND selection is built between the available category tree elements of the same page. | 1 |
CategoryTree | ->CATEGORYTREE | Path: plugin.tx_damfrontend_pi1.categoryTree | |
UseLanguageOverlay | Boolean | Defines, if the language overlay should be used. If you have trouble with empty category titles, set this value to 0 | 1 |
Wrap | StdWrap | Wraps the whole tree | |
PlusIcon | IMAGE | Rendes the plus icon: | |
catTitle | StdWrap | ||
CatTitle.no_access | Wrap | ||
CategoryTitle.length | Integer | Crops the title after n chars | 30 |
Category | Wrap | Wraps the whole category line | |
ExpandTreeLevel | integer | Defines which levels of tree are expande by default. Currently only 0 and 1 are supported | 0 |
MinusIcon | IMAGE | Renders the minus icon: | |
EqualsIcon | IMAGE | Renders the equals icon | |
StdWrap | StdWrap | Wraps the whole tree | <div class="cattree">|</div> |
StdWrapControl | Wrap | Wrap the controls of the category line | <div class="control" >|</div> |
CategoryTitle | TYPOLINK | ||
treeRootIcon | IMAGE | Icon for the root element of the tree | |
treePlusIcon | IMAGE | Plus Node of tree (a click expands the tree) | |
treePlusIconBottom | IMAGE | Plus Node of tree (a click expands the tree) if the node is the last element in this tree level | |
treeMinusIcon | IMAGE | minus Node of tree (a click folds the tree) | |
treeMinusIconBottom | IMAGE | minus Node of tree (a click folds the tree) if the node is the last element in this tree level | |
treeJoinIcon | IMAGE | Tree icon for a category with no childs | |
treeJoinIconBottom | IMAGE | Tree icon for a category with no childs if the category is the last element in the tree level | |
treeCatIcon | IMAGE | Icon for the category | |
TreeRoot | wrap | ||
treeNavIcons | default objects are IMAGE | ||
TreeNavIcons.line | IMAGE | Conection line in the category tree (vertical between categories) | |
TreeNavIcons,blank | IMAGE | Blank space to shift the child elements to right | |
_CSS_DEFAULT_STYLE | CSS is included in the static template. If you want to define your own, you overwrite the default css in your typoscript configuration. example: plugin.tx_damfrontend_pi1._CSS_DEFAULT_STYLE < | see example code below | |
mediaTypes | array | Set the icons for filetypes. You can define new ones. By default, icons are placed in /res/ico in the extension directory. Example: mediaTypes { DEFAULT { DEFAULT = default.png } image { DEFAULT = image_default.png } } | |
iconBaseAddress | String | Path to the icons, if you want to use your own fileicons. Must end with a slash, starts relative from your website root. Example: iconBaseAddress = fileadmin/icons/ | If no value is set, the extension uses ext_path/res/ico/' |
renderFields | array | In the view “file_list” and “single_view” all fields have the stdWrap Property. plugin.tx_damfrontend_pi1 { renderFields { # set stdWrap config for each field file_size { setContentToCurrent = 1 if.isTrue.current = 1 bytes = 1 bytes.labels = "Bytes| Kilobyte| Megabyte| Gigabyte" } } | In the static template the field “file_size” is defined. Each dam_field can used in the same way. |
allowedLanguages | String | This is used for the upload form and the searchbox. There is a dropdownlist with languages. Use ISO Codes like EN or DE plugin.tx_damfrontend_pi1.allowedLanguages = EN, DE | |
langFile | String | Path & Filename to an additional language file. Sample can be found in res/sample_additionally_langlabels.xml For more information take a look in the section template. | |
filelist | → FILELIST | Path: plugin.tx_damfrontend_pi1.filelist | |
form_url | TYPOLINK | Sets the target for form, should be normally the current page. | form_url.parameter.data = TSFE:idform_url.addQueryString = 1 |
defaultLength | Integer | Sets the length of the filelist | 10 |
useAlternatingRows | Boolean | If set to 1, the filelist_record_alterning property of the marker setting is used. So an option split is possible. | 1 |
marker.filelist_record | String | This marker in the html template is used, of useAlternatingRows is 0 | ###FILELIST_RECORD### |
marker.filelist_record_alterning | String | This marker in the html template is used, of useAlternatingRows is 1 | ###FILELIST_RECORD_ODD### |*| ###FILELIST_RECORD_EVEN### || ###FILELIST_RECORD_ODD### |*| |
searchwordFields | String | comma separated field names: Defines in which fields a full search should be done. | title, description |
usePreDefinedSorting | boolean | 1 | |
orderBy | String | If usePreDefinedSorting is set to 1: Define here for which field(s) is sorted by default. Please use this like an order by statement in a sql query. FE: “datemod ASC” set the sorting to date modified ascending. | crdate DESC |
sortLinksForTitles | boolean | If set to 1, the column titles are rendered as links to change the sorting of the filelist. But for each column title a typoscript element must be existing. See sortlinks | 0 |
Sortlinks.asc | cObject | COBJECT to render the sortlink for ascening sorting. | asc = TEXTasc.data = LLL:EXT:dam_frontend/pi1/locallang.xml:asc |
Sortlinks.desc | cObject | COBJECT to render the sortlink for descending sorting. | desc < .asc desc.data = LLL:EXT:dam_frontend/pi1/locallang.xml:desc |
Sortlinks.[DAM_COLUMN] | If sortLinksForTitles is set to 1, Column titles are rendered with links for sorting. But please take care, that for each column title a typoscript settings available. Example:title < .asc title.data = LLL:EXT:dam_frontend/pi1/locallang.xml:LABEL_TITLE title.asc.wrap = <span class="Sort_Desc">|</span> title.desc.wrap = <span class="Sort_Asc">|</span> title.no_sort.wrap = <span class="Sort_Not">|</span> | ||
latestView.latestDays | integer | Sets how many days from now added / changed files should be shown | 30 |
latestView.useCatsAsMounts | boolean | Categories which are selected in the flexform are used as mounts, if set to 0 they are used as single cats | 1 |
latestView.field | string | latestField must be date field of the dam table (tx_dam) | crdate |
latestView.limit | integer | shows only the last nr. of items, only used if latestDays are set to 0 | 20 |
staticCatSelection.selectChildCats | boolean | if turned on, all childs of a selected category are selected too (cats are selected statically in the BE) | 1 |
link_download | cObject | Renders the download link. Take care that the parameters of the typolink are used, if you create your own link. | link_download = IMAGE link_download { file = EXT:dam_frontend/res/ico/clip_pasteafter.gif #style="border-width: 0px stdWrap.typolink { parameter.data = TSFE:id additionalParams = &eID=dam_frontend_push&docID={field:uid} additionalParams.insertData = 1 } } |
link_single | cObject | Renders the link to the single view | link_single = IMAGE |
button_catedit | cObject | Renders the link to the catedit view | button_catedit = IMAGE |
button_edit | cObject | Renders the meta data edit view | button_edit=IMAGE |
button_delete | cObject | Renders the delete message | button_delete = IMAGE |
security_options.showOnlyFilesWithPermission | Boolean | If set to 1, only files that have explicit file permissions are shown | 0 |
security_options.deleteFilesOfDeletedRecords | Boolean | If set to 1, then files will get deleted too, if a dam record will be deleted | 0 |
browselink.browselinkUsePrevNext | Boolean | If set to 1, “next” and “prev” are added to the browselinks (resultlistlinks) | 1 |
browselink.resultList.wrap = | | Wrap | Wrap for the whole resultlist | |
Browselink.wrap | Wrap | #wrap for a single browse link e.g. 1, 2, ... | |
browselinkCurrent.wrap= | wrap | Wrap for the current page of the resultbrowser | <span style="border: 1px solid black">|</span> |
fileDeleteSuccessMessage | Typolink | Renders the link to the success message, if a file was successfully deleted | |
fileDeleteMessage | Typolink | Renders the link to the fileDeleteMessage, if a file should get deleted | |
fileEdit.uids_FEGroups | list | members of these FE groups are allowed to edit (commaseparated list of uids) | |
fileEdit.button_confirm.wrap | wrap | ||
fileEdit.button_cancel.wrap | wrap | ||
Filterview | FILTERVIEW | ||
SearchCatsAsMounts | String | There is a checkbox “search in all categories”. If you define categories in the filelist element at the same page ,you can choose with this option if the selected cats should be seen as a mount or a normal category. A mount selects all sub categories automatically, a normal category is only the selected category. | 1 |
drillDown | → DRILLDOWN | Path: plugin.tx_damfrontend_pi1.drillDown | |
selectorBox | stdWrap | stdWrap for the whole content element | stdWrap.wrap = | |
selectorBox.css.id | string | name for the css ID which should be used. For each drill down level an interger id is added. F.E. tx_damfrontend_pi_drilldown0, netx level tx_damfrontend_pi_drilldown1 | tx_damfrontend_pi_drilldown |
selectorBox.css.class | string | css class name for the selectorbox | tx_damfrontend_pi_drilldown |
selectorBox.option | stdWrap | Wrap for the catname in the option tag. | option.stdWrap.wrap = | |
displayAnEmptyOption | boolean | Adds an empty entry to the selectorbox. | 1 |
Upload | → UPLOAD | Path: plugin.tx_damfrontend_pi1.upload | |
AutoAssignFEGroups | list | comma separated uids of fe_groups | |
AutoFillFEUserData | Array | #left side column of the dam record - right side fe_user column creator = name upload.autoFillFEUserData { creator = name } | upload.autoFillFEUserData { creator = name } |
enableCategoryPreSelection | boolean | If enabled, categories can be set in the backend (upload form content element) to pre selected categories in the upload process. | 1 |
preSelectChildCategories | boolean | if enabled, the selected categories in the backend act as a cat mount. So all childs of the category are selected too. This is useful if you want select a lot of categories. | 0 |
allowedVersioningMethods.versioning | boolean | enables (basic) versioning of file | 0 |
allowedVersioningMethods.versioning.wrap | wrap | wrap for the versioning label. Please take care that the post value and the marker remain with their names | <input type="radio" name="version_method" value="new_version" /><label>###VERSIONING_NEW_VERSION###|</label><br /> |
allowedVersioningMethods.overwrite | boolean | enables overwrites of files | 1 |
allowedVersioningMethods.overwrite.wrap | wrap | wrap for the versioning label. Please take care that the post value and the marker remain with their names | <input type="radio" name="version_method" value="override" /><label>###VERSIONING_OVERWRITES###|</label><br /> |
allowedVersioningMethods.newRecord | boolean | enables to create a new file (with altered name), if a file already exists | 1 |
allowedVersioningMethods.newRecord.wrap | wrap | wrap for the versioning label. Please take care that the post value and the marker remain with their names | <input type="radio" name="version_method" value="new_record" /><label>###VERSIONING_NEW_RECORD###|</label> |
useOneStepUpload | boolean | if enabled files are already accesible after the first upload step. So the other upload steps (enter meta data / categorization) are not mandatory anymore | 0 |
successMessage.form_url | TYPOLINK | formurl action | form_url.parameter.data = TSFE:id form_url.addQueryString = 1 form_url.returnLast = url |
renderUploadForm.form_url | TYPOLINK | formurl action | form_url.parameter.data = TSFE:id form_url.addQueryString = 1 |
renderUploadForm.button_upload.wrap | wrap | Wrap for the upload button | |
conf | TYPOSCRIPT | configuration of the extension file_upload. The typoscript is added here, to avoid problems. | |
conf.UploadTempDir | String | defines the path where files are stored temporaly during upload. | dam_frontend_upload/ |
conf FeuserHomePath | boolean | if enabled, each FEUser gets a own directory for his files (recommended) | 1 |
conf. FeuserHomePath.field | String | Defindes which field of the fe_user is used to name his homePath | Username |
Some typoscript examples
Thumbnail in the listview:
renderFields { title { prepend = IMAGE prepend.file { import.dataWrap = {field:file_path}{field:file_name}| width = 100m height = 100m } prepend.stdWrap.wrap = |<br /> # Only if the file could be rendered prepend.stdWrap.if.isTrue.data = TSFE:lastImageInfo|0 }
DAM Frontend Filelist
Property: | Data type: | Description: | Default: |
|---|---|---|---|
templateFile | string | Path & filename to html template. Defined via a constant by default. Can be set by the constant editor. | typo3conf/ext/dam_frontend/res/tmpl_list.html |
_CSS_DEFAULT_STYLE | CSS is included in the static template. If you want to define your own, you overwrite the default css in your typoscript configuration. example: plugin.tx_damfrontend_pi2._CSS_DEFAULT_STYLE < | see example code below | |
mediaTypes | array | Set the icons for filetypes. You can define new ones. By default, icons are placed in /res/ico in the extension directory. Example: mediaTypes { DEFAULT { DEFAULT = default.png } image { DEFAULT = image_default.png } } | see example code below |
You can built your own template for both plugins (pi1 & pi2). The easiest way is to copy the orginal template to your template folder (normally somewhere below fileadmin.
Plugin DAM frontend
available markers
The view filelist supports all fields of the table “dam”. If you want to show a field of the table, just look into the table definition of the table “tx_dam”, take the name of the row and put it into the markers.
Example: Field title of the dam table: ###TITLE###
Creating your own multilanguage labels
Ok, no you extended your template for a new field. But maybe you need a caption for new field. If you use a single language website, you can just add a caption where ever you like in your template. But if you use a multilanguage website, you have to take another way – multilanguage labels.
To create a own multilanguage label, you have to set up a custom language file. Extend your typoscript template for the line plugin.tx_damfrontend_pi1.langfile = fileadmin/yourLangFile.xml
Take a look in the subfolder res in the extensions folder. There you find a sample file. Copy the sample file into your template folder and extend the file for your own labels.
Now you add a multilanguage labe marker to your template, like this ###LLL:NAME_OF_YOUR_MARKER###
Here is the corresponding structure in your langfile:
<T3locallang>
<meta type="array">
<type>module</type>
<description>Custom markers for dam_frontend</description>
</meta>
<data type="array">
<languageKey index="default" type="array">
<label index="NAME_OF_YOUR_MARKER">we are interested in</label>
</languageKey>
<languageKey index="de" type="array">
<label index="NAME_OF_YOUR_MARKER">Wir interessieren uns</label>
</languageKey>
</data>
</T3locallang>
Plugin DAM frontend filelist
You can use currently these markers: 'uid','title', 'ident', 'description', 'file_path', 'file_name', 'file_size', 'file_mime_type', 'file_mime_subtype', 'file_type', 'file_mtime'
Please use the marker in our template this way: ###MARK_MARKERNAME###