4

I want to disable the modification of both the file name and title of a specific asset type.
How can I do that ?

enter image description here

2 Answers 2

5

I guess this feature request will solve my problem... in the future:
http://feedback.buildwithcraft.com/forums/285221-feature-requests/suggestions/7197199-ability-to-hide-or-disable-fields-based-on-a-user

But in the meantime I did it with a small css hacking (no choice):

protected function includeResources()

switch ( $segments[ 0 ] ) {
    case 'entries' : case 'categories' : case 'assets' :
        craft()->templates->includeCssResource( 'plugin/styles.css' );
        break;
}

style.css

// remove title and name fields from modal editor in CP assets page
    .hud {
        .body.elementeditor {
            .field[id$="filename-field"], .field[id$="-title-field"] {
                display: none;
            }
            .field {
                margin-top: 0px;
            }
        }
    }

Works fine :
enter image description here

1

You can disable the capacity to upload, remove, or create subfolders for assets to whomever you wish through the users control panel.

You could potentially solve this problem by limiting the users control to allow them only to upload and not change folders or delete. (see image below)

Craft User Limitation

4
  • No those permissions are not precise enough in my case. I just want to disable name and title fields.
    – migmaker
    Commented Aug 14, 2015 at 17:56
  • hmm, really sorry wouldn't know then :/ ... Maybe there is some kind of plug-in that could help here.
    – Matteo
    Commented Aug 14, 2015 at 17:59
  • Right I am making it indeed :D
    – migmaker
    Commented Aug 14, 2015 at 18:00
  • Awesome, goodluck my friend!
    – Matteo
    Commented Aug 19, 2015 at 19:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.