The best way to generate buttons and apply visibility restrictions based on roles

Solutions

you can simply create different class for each type color and based on the role you can add the class to the button.

Tags: Drupal 8 / Blocks

Similar questions

apply css for particular node and do not apply for particular node
I used the CSS injector module to replace the default CSS. I applied that CSS for paths like node/*. How do I exclude node/add from that CSS (the one I created with the CSS injection module)?
How to insert social share buttons in drupal 7 using Bootstrap Social Sharing Buttons?
I am using module Bootstrap Social Sharing Buttons in my D7 site. I can show e-mail, twitter, facebook and google+ but I donĀ“t know how to insert others social buttons like linkedIn.
Rename/hide "Save" and "Save as draft" buttons for non-admin roles
I have four content types on my site that registered users can create, but they are set to be approved by admins before publishing. Since the site also sends out notifications to subscribers when a new node is created, the following problem occurred - the regular users could save new nodes which are not published until approval, but the notificatio...
Best way to get best breadcrumbs for Commerce
When a user is checking the product page, the breadcrumb trail should give Home > Shop > Category > Product aka Home > Shop > Hats > A Hat I used Crumbs, but it only gives me Home > Hats > A Hat and I cannot figure out how to include > Shop >. Well obviously at the same time the breadcrumbs should also work fine in the rest of the pages like for co...
Can the Devel Generate module generate content for all possible permutations and combinations?
I love the Devel Generate module as it helps me to create test content very quickly. Random content that the module generates is sufficient most of the times. But at times I would like to have content for all the permutations and combinations. For example let us say that a content type has three optional fields. So in total I would like to have 8 n...
Remove one of the two "Apply to selected items" submit buttons with Node Bulk Operations
If you make a view and add the Node operations bulk form, two "Apply to selected items" boxes are automatically generated like this: How do I get rid of one of these? I turned on twig debugging, but the template that is outputting the button is core/modules/system/templates/container.html.twig, which is not something that I can easily cus...

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.