By frychiko on
Hi,
Regarding CCK, I have a question if anyone would be so kind to answer:
How do I hide fields created with CCK? I do not want to them show up when creating a new type because they will automatically be filled in during db insertion or filled in at a later date.
for example fields such as:
date_created
num_products_imported
cheers,
Frychiko
Comments
Select the
I thought it was the following, but this is not true, the following is just for the form display, not for someone creating content
Select the following
Administer -> Content Management -> Content Types -> Manage Fields -> Display Fields
Then for each element you want to be hidden, select "hidden" from the drop down menu in each of the following
Label
Teaser
Full Node
Then hit save, that should do it.
_
For content creation, you could either use a computed field or use the content permissions module and don't give the view field permission to whatever roles you don't want to see it.
think the latter doesn't
think the latter doesn't work.
if you give no view/edit rights to roles to view some fields, theese fields are NOT automatcally filled out to their standard values if you don't have the right permissions...
How to create Hidden field in CCK?
I tried this
//----------------------------------
Select the following
Administer -> Content Management -> Content Types -> Manage Fields -> Display Fields
Then for each element you want to be hidden, select "hidden" from the drop down menu in each of the following
Label
Teaser
Full Node
//------------------------------------
But its not working..
I have to put some default javascript code into hidden field for displaying sponsered link in between of the page.
How???
TIA
Following code is able to
Following code is able to make a CCK field becoming a hidden type field.
Method 1:
Method 2:
Method 1 work for me
Thank a lot gala4th, method 1 work for me like charm.
Truyenle
One thing to bear in mind
One thing to bear in mind with method 1 is that someone can simple use firebug to set display:block to make the element visible.
Not a problem if you are not worried about security however.
Method 2 Excellent!
Method 2 is more secure than 1.
User can not manipulate the variable.
Nice
Method 1 Ok... Thanks!!!
Hello, I would like to hide 2
Hello, I would like to hide 2 cck fields.
File attachments (upload)
Upload Inline File (field_upload_inline_file)
What do I put in place of 'YourModuleName'?
YourModuleName_form_alter
This should be in CCK
Anyone knows if they are going to include it? There should be a difference from excluding the field and turning it into a hidden field.
If you have your field
If you have your field populated automatically with a default value (you set up when creating the field), then you can hide the field on the form and expose it on the node's view easily. All you have to do is to set the permissions... do not give the role permission to edit the field on the form, and do give the same role the permission to view the field. So, without the user doing anything, after creating the node, the new field will come up.