Home

DAM: Hiding fields through TSconfig

Sunday, September 21st, 2008 | Author: Benni

Long time no see… yes, business is keeping me away from all the fun stuff. I’m currently working on cleaning up and then extending mm_forum, and of course the TYPO3 core.  Last week, I visited Jeff in Dallas and we had a good run digging into some serious XML issues with libxml2 and expat (See http://bugs.typo3.org/view.php?id=9359) and we also looked into over 20 patches floating around in the TYPO3 core list.

Yesterday I spent some time working on my seo_basics extension and on the last fixes for the upcoming DAM (Digital Asset Management) version 1.1 — a beast of an extension,  but good for adding metadata to uploaded files. While there was a huge movement in May and June, things kinds slowed down in the last months, and Ben pushed the whole thing a bit more. In any case, 1.1 will be a bugfix release (with a dependency on TYPO3 4.2.2 or later) marking the way for a glorious 1.2 (Release TBA ;-)).

After testing and commiting couple of patches, I looked into one other issue, namely to hide certain fields when editing a DAM record. Although the DAM has its own module and submodules, it uses the default TCEforms for editing metadata of files. If you decide to hide certain fields from your editors (and / or admins), there are several ways to do so. First of all, you can probably configure it through the huge excludelist of a Backend usergroup. Somehow, I got away from using excludelists, as it’s just a pain. The variant I like more is to use an approach to hide fields in TCEforms through pages TS config. This way you can hide all fields of a table that is listed in the TCA. It’s not preventing a BE user (rights-wise) to edit a certain field in the BE, but as he won’t see the field anyways I figured that this is enough for most cases.

For the DAM, all metadata (DAM) records are in the DAM media folder in the page tree. This one is sometimes hidden, depending on your installation. If you don’t see the “Media” folder in the page tree, go to the Extension Manager, edit the Install-time options of the DAM / Media Extension and disable the checkbox “Hide Media Sysfolder”. After that, you can select the media folder. Edit its page properties (it’s nothing else than a sysfolder anyway, btw). Select the “options” tab, where you can add the pagesTSconfig. With a

TCEFORM.tx_dam.publisher.disabled = 1

the publisher edit field won’t be rendered when editing a metadata record. Oh yeah, this of course works for all other TCA tables as well. I use it in the page properties to remove all language-related fields in an installation with only one language to help unclutter the interface.

A complete list of all fields to disable the DAM is attached here:

TCEFORM.tx_dam {
    hidden.disabled = 1
    starttime.disabled = 1
    endtime.disabled = 1
    fe_group.disabled = 1
    sys_language_uid.disabled = 1
    l18n_parent.disabled = 1
    l18n_diffsource.disabled = 1
    t3ver_label.disabled = 1
    media_type.disabled = 1
    title.disabled = 1
    file_name.disabled = 1
    file_path.disabled = 1
    file_dl_name.disabled = 1
    file_type.disabled = 1
    file_type_version.disabled = 1
    file_size.disabled = 1
    file_orig_location.disabled = 1
    file_orig_loc_desc.disabled = 1
    file_creator.disabled = 1
    file_mime_type.disabled = 1
    file_mime_subtype.disabled = 1
    file_ctime.disabled = 1
    file_mtime.disabled = 1
    file_usage.disabled = 1
    ident.disabled = 1
    creator.disabled = 1
    publisher.disabled = 1
    copyright.disabled = 1
    keywords.disabled = 1
    description.disabled = 1
    caption.disabled = 1
    alt_text.disabled = 1
    instructions.disabled = 1
    abstract.disabled = 1
    date_cr.disabled = 1
    date_mod.disabled = 1
    loc_desc.disabled = 1
    loc_country.disabled = 1
    loc_city.disabled = 1
    language.disabled = 1
    hres.disabled = 1
    vres.disabled = 1
    hpixels.disabled = 1
    vpixels.disabled = 1
    color_space.disabled = 1
    width.disabled = 1
    height.disabled = 1
    height_unit.disabled = 1
    pages.disabled = 1
    meta.disabled = 1
    category.disabled = 1
    parent_id.disabled = 1
    deleted.disabled = 1
    index_type.disabled = 1
    file_inode.disabled = 1
    file_hash.disabled = 1
    file_status.disabled = 1
    tstamp.disabled = 1
}

Although this is pretty simple and straightforward, some might want to use this. As far as I know there is currently no (easy) way to change the visibility of the fields in the other screens. Nevertheless, watch out for an updated version of the DAM, going with the latest (also soon to come 4.2.2) TYPO3 core in the near future.

Tags » , «

Trackback: Trackback-URL | Comments Feed: RSS 2.0
Category: TYPO3

You can leave a response.

3 Responses

  1. dont worry, rss keeps fans informed ;)

  2. hey benni,

    very usefull. was waiting for this! tHNx

    ben

  3. Thanx! I was searching this for a while! :)

Leave a Reply