0

I need to delete the "Remove button" on every edit field collection for specific role users. I have 3 roles (Admin, Project, Test). Just Admin and project can see the "delete" button and "add" button to remove lines or add a new line. The others roles are not allowed to delete or add new line in the field collection.

I tried to change some permissions (Administer field collections - Create and delete fields on field collections.) But it didn't work...

I need to use HOOK ? or maybe just JQuery ?

To complete my explication, here an example :

Field collection remove button "Supprimer"

Thanks

PS : "Supprimer" = "Remove"

  • Hello. I removed dead link. There was no image under it. If you need to post image, use image tool on editor's toolbar here. But please do your best to write what you want, images should be only a supplement, not main content of your post. By Help Center, implementing a functionality for which only a screenshot is provided is not allowed. – Mołot Oct 1 '14 at 9:23
0

Write following code in your theme template.php file. It will added css classes to body of a specfic page.

    <?php 

    function hook_preprocess_html(&$variables) {
      global $user;
      $args = arg();

        if( isset($args[0]) && ($args[0] ==  'your-page-url-first-argument')){ // Check ur page url parameters
        $account = user_load($user->uid);
        if(in_array("test", $account->roles)){
          $variables['classes_array'][] = 'test_user';
        }
      }?>

CSS:

.test_user [remove_button_class/id] {

  display:none

}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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