I am working on a drupal 8 website and I would like to know how to enable 'View','Edit','Revision' buttons on a page level as below:
Can these buttons be added at 'node' level without editing module.node file? Can someone guide on this?
Simply add the Primary admin actions block in the region you want (/admin/structure/block) and manage the node permissions of your users roles.
Related
On my company's Drupal 7 site, I created a field for one of our content types through the admin UI. We decided to hide it from the user until some styling changes make it through to production. Is there a was to programmatically unhide the field via an update hook? I know get at least some of the field information through the field_info_field function, but I'm not sure how if it contains the setting needed to make the field visible to the user. Any help on this would be appreciated.
I know I can unhide it through the UI once the changes hit production, but it would be nice to have an automated way of doing this.
You can hide it programmatically from it's node template with hide() function:
https://api.drupal.org/api/drupal/includes%21common.inc/function/hide/7.x
You can do that conditionally, i.e. by checking user role first.
Now, I'm not sure will this work from update hook, and I'm not even sure why you want to use that hook?!? If users are allowed to edit that content type and you actually want to hide it from edit form then check out my answer here:
Drupal 7 - Hide certain form fields of a content edit form depending on the content data
You can use https://www.drupal.org/project/field_permissions drupal module to hide and unhide fields to users of specific role.Initially during development the field can be made visible to admin role and then later on the permission can be granted to users of other roles
I am building a social networking site with drupal 7.32.I am using Profile2 module for user profiles.I have added fields to the default profile type.Now, I want to display the profile on the right side of the two column stacked layout of the panel.After creating the panel pages and on the last screen where the layout appears when I click on the gear and add content the next screen asks for node id which I am not able to fill.What should be the node id ? I am in a fix.
Any and all help would be appreciated.
Are you using the Page manager? Add the "currently logged in user" to the context and you should get the ability to add personal information to the page.
Another way to go is to create a view with a contextual filter to the currently logged in user. The view can then later be displayed on the panels page (without context).
I would like to add a page where users can submit content (not just a comment, but a specific 'content type' including the relevant fields). I could use the regular admin link but that would require alternating the admin theme a lot and also would need to hide/disable things i otherwise need.
Is there a good way to display a submission form to the users through which they can submit content? I was looking for a solution via 'Views' but didn't get far.
I hope i managed to get my point across.
drupal 6 or drupal 7?
in drupal 7 you have the field API that is very helpfull to get the fields of an entity.
in drupal 6 you can create your own form with forms API and run node_save() in the submit function.
If the only problem with using the usual node/add/node-type page is that you don't want users to see the admin theme, then you don't have a problem. You can disable the admin theme for non-admin users - on the permissions page, look for "System / View the administration theme". It's already unchecked by default, I think. Any adminny-type pages they access will use your default public-facing theme.
I want to disable or hide edit link for specific role on node view page.
Make sure the role does NOT have administer nodes permission
Also make sure the role does not have edit any <content type> permission & edit own <content-type> where is the content type you want to disable editing for.
I would also suggest you pickup a decent book on Drupal -- it will teach you the fundamentals. I'm guessing you're reasonably new to Drupal.
I want to hide these fieldsets in a Drupal 6 site for some content types (not for all of them), because these options are unnecessary and confusing to the end user.
How can I do this?
Thank you!
NodeFormCols sounds like the module your after. As well as hiding fieldsets, you can control the order they will appear in, and whether or not they should be collapsed.
As well as that the "Hide publishing options" module allows you to pick which checkboxes to hide within the publishing options fieldset.
If you are talking about when editing a node, this is related to permissions, so those fieldsets will only be displayed according to the user who is editing the node.
If you want to hide them, you could use hook_form_alter to alter the $form array. You have to be careful about this, so it wont be impossible for users to edit the those sections of the node.
Go to Site Building ->Themes ->Select the particular theme and CLICK "Configure" link. You can see various settings, in which you go to Theme-specific settings ->Node Settings ->Author&Date
Make the changes you need and its done!
(This will be easy if we are using a contributed or custom theme)
Check out the Simplify Node Add module.