3

I know how to make custom fields for my custom post types. But I need a pretty complex custom field this time. I'm making a website about agricultural machinery. There are a lot of types of machines. For every type of machine there are some products available with properties like size, mass, diameter, capacity, ....

Per type there is only one description, one title and one image needed. So my custom post-type machine contains posts (custom type = machines) with the basic information. For every machine I would like to sum up all the different size - mass - capacity - prize information in a table. I know I could just create a html table in the description, but I would really like the data to be structured so I can nicely style it, and eventually even do structured searches for price and stuff.

So ideally I would like to have a custom field that looks a bit like an excel sheet where I can create some columns and add rows per available product in the category. Any ideas how I can do this?

EDIT: I'm trying out the Types wordpress plugin http://wordpress.org/extend/plugins/types/. There's an option to group custom fields together and also an option to allow multiple instances of one field. Would be useful for me if there would be a possibility to allow multiple instances of a group. Does something like that exist?

EDIT: This looks promising. http://wp-types.com/documentation/user-guides/bulk-content-editing-with-fields-table/ I will look into it and maybe answer myself if it turns out to work :)

2
  • Why do you want to merge all the values together in one custom field instead of having multiple? That's just hard to search. Maybe to some of the fields as taxonomy? Commented Sep 13, 2012 at 11:05
  • I don't want them all in one field. I want a field-structure that resembles a logical grid. Every machine-type has a bunch of different specifications. I could group these specifications together, but additionally I want the groups to be repeatable aswell. In other words I need multiple rows of specifications for every machine-type Commented Sep 13, 2012 at 11:38

1 Answer 1

1

It seems like wp-types had the solution all along. http://wp-types.com/documentation/user-guides/bulk-content-editing-with-fields-table/

This is what my custom data table looks like now:

enter image description here

Behind the scenes, all data is not actually saved in a single post. But wp-types allows you to create hierarchical relations between post types, and then provides a way to quickly create sub-posts straight from the parent. That's awesome enough for me.

In my case I created two post types. One called machine-type and another called machine.

machine-type holds all the basic information about the machine (title, description and image) while it's sub-type machine holds the specs for any of the different variants.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.