custom fields

Events happening in the community are now at Drupal community events on www.drupal.org.
peijun's picture

Hi,

I just installed OA2 on my box. I am wondering if there is any way to create custom fields (say for task section) like Redmine?

Thanks

Comments

Yes, you can add custom fields!

dsnopek's picture

Yes, you can add custom fields! Open Atrium is built on Drupal, which allows you to add arbitrary fields to any of the content types.

So, adding a field to a Task is no problem, but there are a couple special considerations with Tasks:

  • If you want to be able to modify the field via comments (like most of Task's fields), then you need to be sure to check "Enable altering this field from comments" when configuring the field.
  • You may want to consider adding your field to the "Task information" field set on the form and/or display, so that it appear next to the other fields

And like with making any modifications to configuration that is managed by Features (all the default Open Atrium content types are), you should put your customizations into your own Feature using the Features Override module.

I hope that helps!

Thanks, please give me some detailed instruction

peijun's picture

Thanks a lot, dsnopek.

I tried to follow the instructions in the features override module but I did not figure out how to do it. Maybe it is a little to much, could you please give me some detailed instructions?

Before I posted the question, I have tried several ways. Firstly, I modified the task content type by adding a new field. It works partially. I can see the new field in the creation form and edit form, but it disappears in the section of Update task and add new comment of view page. Also, this is global change. It is not what I need. I need the custom fields to be space/subspace specific.

Secondly, I created a new content type by cloning the original task content type and adding new fields. I added new taxonomy term to vocabulary Section type. I am able to see the new section type in the create new section list and able to create new tasks. However, after new tasks are created, they are showed only in Recent activity but not in Tasks table. If there are any ways to add the newly created tasks to the Tasks table, I think this strategy is fine for me.

Of course, what I did might not the right way to solve the problem.

Could you give me some hits?

Thanks,

Peijun Zhang from Canada.

More documentation and some short answers...

dsnopek's picture

Here are some blog posts about Features Override that I hope will be helpful:

To answer some of your questions:

Firstly, I modified the task content type by adding a new field. It works partially. I can see the new field in the creation form and edit form, but it disappears in the section of Update task and add new comment of view page.

Like I mentioned above, in order to be able to modify the field via comments (like most of Task's fields), then you need to be sure to check "Enable altering this field from comments" when configuring the field.

Also, this is global change. It is not what I need. I need the custom fields to be space/subspace specific.

Unfortunately, in Drupal fields are global for each content type. However, there is probably a way to make a field only visible in a particular Space or sub-Space. This could definitely be done in custom code, but is probably also possible using the Rules module. There may even be some OG-specific module somewhere that does this, but I'm not aware of it.

Sorry, this isn't something I personally have any experience with. :-/ Maybe another community member will know?

Secondly, I created a new content type by cloning the original task content type and adding new fields. I added new taxonomy term to vocabulary Section type. I am able to see the new section type in the create new section list and able to create new tasks. However, after new tasks are created, they are showed only in Recent activity but not in Tasks table. If there are any ways to add the newly created tasks to the Tasks table, I think this strategy is fine for me.

The "Task list" widget is a View that specifically filters for the original Task content type. So, you'll need to clone that View as well and modify it to show your new Task conent type.

I hope that helps!

Thanks

peijun's picture

I followed my second strategy and your instructions and I solved the problem. Now I can add any custom fields which are space specific.

Thanks,

peijun

Thanks to all

posimito's picture

I would appreciate peijun could explain how he achieved custom fields to be space specific. Thanks in advance.

Add custom fields

peijun's picture

Hi All,

Here are my strategies. However, I do not assure they are perfect. Advices and suggestions are welcome.

I used two strategies.
Strategy 1
If there are only some custom fields need to add, I modify the original content type Task.

  1. Add all custom fields to Task. (if you would like the fields to be shown in comment form, check ' Enable altering this field from comments'
  2. Modify display and comment fields settings if required.
  3. Add conditional dependencies rules if you would like your custom fields to be shown up dynamically. (All my custom fields are shown up based on section id)
  4. Modify views. If you would like your custom fields to be shown in the view section task list and user dashboard task list, modify the view Open Atrium Work Tracker: display task list and user tasks.
    Or you can make a new view and new panelizer for content type Section page (see below)
  5. Create features. (I did not do it. I think this is only useful when you update OA package. Am I right?)
    Create two new features (one for OA users, one for OA Work Tracker) and install them.
    Strategy 2
    If your new task type is very different from the original one (say many custom fields, some fields in original task are not used), I would create a new content type.

  6. Create a new content type, enable panelizer

  7. add some existing fields such as oa_section_ref and og_group_ref. Other fields are optional.
  8. Add your custom fields and put them in a fieldgroup if required.
  9. Modify display and comment fields settings
  10. Add conditional field rules if required
  11. Set panelizer Full page override
    Setting: check Renderer Standard In-place Editor
    Layout: select a layout, such as Bryant
    Content: Add some major fields or Rendered Node full content to your content pane . Add Open Atrium Sidebar top (in Open atrium), Open Atrium Sidebar bottom (in Open atrium), and some small custom fields to sidebar.

  12. Create new view
    Create new task list view (display: view pane) for your new content type (You can add any types, actually). You can clone the view Open Atrium Task tracker and modify it.

  13. Add a new panelizer to Content type Section page Full Page Override
    Administrative title: your task Section
    Renderer: Standard or In-place editor
    Layout: Brant Flipped
    Content: view: your new view:task list. Optional: this node title, this node body
    Sidebar: Content visibility, group menu, etc.
  14. Add new term ‘Your new term’ to Taxonomy: section type
    Name: your new term
    Section Layout: your new section created in 8.
    Node Types: your new content task type (and other types if required)
  15. Test and enjoy!

Open Atrium

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: