Best way to hide some fields
crooke - June 9, 2009 - 12:01
| Project: | Flexifield |
| Version: | 6.x-1.0-alpha4 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Hi,
this is a very good module! I can see it being used for a lot of reasons, thanks very much for contributing!
I've got a little question, I added a flexifield to one of my content types. So now the field "embeds" fields from a different content type. My question is, how do you disable / hide some fields from the embedded content type? Is it possible to do somehow? Or should I just create another content type with only the fields I need?
Thanks in advance!
Rob

#1
Flexifield comes with "display context" submodule. If I understand it correctly, you must do these steps:
Create "test" context for flexifield at "admin/settings/flexifield-displaycontexts". Then go to your source node settings (node which provided all the fields for resulting flexifield), something like "admin/content/node-type/your_source_node_type/display" and there should be "Flexifield" tab. There you can change how your fields display in "test" context. I mean, for hiding field, you can set <hidden> in "test" column. Then you go to resulting node (i.e. node which contain flexifield itself) display settings and set up flexifield display as "test", instead of default.
I tried this, and it worked for me.
#2
Thank you very much, crea, for answering this. I'd like to add two clarifications to your well-written answer.
1) This works if the goal is to hide the sub-fields from display when you're viewing the node. If the goal is to hide the sub-fields from when you're editing the node, there's no way to do that without some other module, and I don't know of a module to recommend, and so, you might just want to create a new content type with only the fields you want for use within your flexifield field.
2) I created the flexifield_displaycontexts module after releasing alpha4, so if you want to use it, you need to get the dev snaphot, or wait until alpha5, which I plan on releasing later this week.
#3
Automatically closed -- issue fixed for 2 weeks with no activity.