drupal edit attachment field of a node - drupal

I have a content type named Properties, users can create the content types
I have file cck field in the content type (properties), now I want to add the attachments to the or edit the attachments field only in a block or panel for the particular property.
Not showing all the fields when user try to edit the content type.
I have heard that this is possible in panels using contexts.
Thanks in advance

Not sure I understand what you want here, but it sounds like you want to change the visibility/editability of fields based on role and display.
To change the visibility and/or editibility based on role, use something like this
http://drupal.org/project/field_permissions
To change it based on display, use the "display fields" tab on the content type edit form.

I think this is what you are looking for
http://drupal.org/project/editablefields

Related

Create a drupal 6 views slideshow from a single content type that has both, image and video fields

I need a little direction. I've created a content type that has both, images and videos attached to a node. I need to create a single frame slideshow that riffles through the mixed media. Currently, I'm using the Embedded Media Field as well as the ImageField to upload the content. I'd like to keep that within the same content type if possible. I was considering separating them and then using taxonomy to make them relational, but that sounds convoluted. At this point, the slideshow displays them both, together.
Could I add both fields to an array in a template file, then return them as one field?
It sounds like you want to add some markup that encapsulates both fields. If that is the case, you can re-write the output of the fields.
Try this:
Edit the "Content: Slideshow main image" field
Enable "Exclude from display"
Click Update
Edit the "Content: Upload Full Size Video" field
Enable "Rewrite the output of this field"
Here you can add whichever markup you want and make use of the field tokens. For example, something like <div>[field_slideshow]<br>[field_upload]</div> Note: The token values will depend on the names of your CCK fields.
Also, for Drupal related questions, there is a separate Drupal Answers exchange where you might get more targeted help.

How to customize content type forms depending on the access

Is there a way to customize a edit page form in Drupal depending on the menu link ? (or by passing additional parameters to the edit page url ?
i.e. I have a children "Add new product" item in both menu items "Catalog1" and "Catalog2".
I want to hide 2 different CCK fields in the product content type depending on which menu item has been clicked.
Or eventually can I pass parameters with the url ? and use these parameters in hook_form API to decide which CCK field to hide ?
Thanks
You probably want http://drupal.org/project/prepopulate.
Hiding the fields, however, is a different thing. You will need to create your own module that uses hook_form_alter to change the type of tields from text/input/select to hidden.
You can try http://drupal.org/project/conditional_fields to hide the CCK fields too.
I've actually solved by passing an additional php parameter from the menu item "Add Product" stating which catalog it should belong to.

Prevent users editing node titles

Is it possible to prevent a user from editing the title of a node on the node edit screen?
One of the things I really detest about Drupal is the rigidity of the title & body field in each node.
Two ways you can do this:
1) Write a hook_form_alter function to set #access to FALSE. This is really quick if you're familiar with writing modules, but if not, you'll probably prefer:
2) Use Automatic Nodetitles to hide the title field completely, create a standard text CCK field to replace it, and then use Content Permissions (which comes with CCK) to restrict access to the new field.
(Also, while the title field is indeed a pain to hide, you can hide the body field just by setting the label to blank.)
Expanding on the tip of hiding the body field, if you use CCK and turn on Content Permissions, you can set field-level permissions, and have a "body" field that shows / is editable however you set role permissions.
If anyone is still interested in drupal7, you can use [title module][1]
[1]: https://www.drupal.org/project/title and turn title to a text field, you then can use [field_permissions module][1]
[1]: https://www.drupal.org/project/field_permissions and set it up however you like by creating a custom permission. The combination of these two module is really flexible.

Changing order of fields in Drupal's content type

I am using Drigg on Drupal 6.17. Drigg has a content type called as "Scoop". I try to change the labels and order of fields. Normally, this is done in Content Management > Content Types > Manage Fields . But some fields that are shown in Create Content screen are not shown in Manage Fields screen.
The screenshot of Manage Fields is here:
The screenshot of Create Content view is here:
The first three fields (Submit the scoop as.., Scoop's URL, Scoop) in Create Content form are not shown in Manage Fields view.
I would like to ask the reason for this. They must be defined somewhere else. Where is it?
Manage fields is for editing CCK fields that you have added. Other fields from different modules often have a weight setting that you can change to move the field up and down, which you would get to from the main content type editing page.

Creating a custom content type in drupal

i tried to create a custom content type in drupal but unnecessary features like Title, Menu settings, and Revision Information, URL aliases come with it which i don't really want ..coz it doesn't mean anything to the user..
how can i hide all those things, just preserving the fields(say only 3 fields from CCK) that i want only for this custom content type??
thanks..
You can automatically generate titles using the auto_nodetitle module, which also enables you to remove the title field from the node submission form.
As others have mentioned above, most of the other form elements don't appear to non-admin users anyway.
With auto_nodetitle module, you can hide it, not remove it. Then, simply assign a title like "your-content-type-nid", so it will be different for each node (nid will be different).
That would be a better title than an empty one.
You will need to do a combination of things to do what you want. One of those is to add the module auto_nodetitle suggested by others. You can hide the "Body" by removing the "Body field label" from the edit screen for your custom content type. Lastly is that you will have to do the right settings for your CCK fields.
If you have CCK fields you want them to be able to edit and others you do not want them to edit, you will need to enable the Content Permissions module in the CCK section of the modules admin page. Once you've done that, you can go to the role permissions page and set what roles have access to which fields. While permissions can potentially hide CCK fields from the user, you can also control what fields are in the teaser, node, and RSS views via the "Display fields" section of your content type editing screens.
Menu settings, revision info and URL alias type info is admin stuff. If you create a new user that doesn't have admin permissions, I'm pretty sure they won't see it.
Can try some thing like below using hook_form_alter.
function my_module_form_alter(&$form, $form_state, $form_id) {
if($form_id='company_node_form'){
$form['menu']['#prefix'] ='<div style="display:none">';
$form['menu']['#suffix'] ='</div>';
$form['revision_information']['#prefix'] ='<div style="display:none">';
$form['revision_information']['#suffix'] ='</div>';
$form['author']['#prefix'] ='<div style="display:none">';
$form['author']['#suffix'] ='</div>';
$form['options']['#prefix'] ='<div style="display:none">';
$form['options']['#suffix'] ='</div>';
}
}
You might want to try the NodeFormCols module. It does several handy things, among them is to add a Manage Form button which allows you to hide most fields in an input form.

Resources