google-code-export / wordpress-custom-content-type-manager

Automatically exported from code.google.com/p/wordpress-custom-content-type-manager
2 stars 1 forks source link

New Custom Fields: Field Groups #392

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What functionality do you want to see?

The idea for this came out of associating 2 content types: exercises and 
workouts.  The exercises are self-contained with a description and a video etc. 
 The trick is this: one exercise might appear on multiple workouts, and each 
time it is used, it might use different options for reps, times, weights, etc.  

So the workflow could be : select an exercise (similar to a relation field), 
then instead of just storing the post_id, you would store options for that 
exercise ON that workout.  Architecturally, it's essentially emulating a join 
table.

I can imagine 2 variants of this:

1. A "table" or "grid" field: you define how many "columns" and what the 
headers are, then when you use one of these fields on a post, you can click to 
add a row.  Bonus points if you could import/export from Excel.

2. A modified relation field that would let you choose a related post, then 
associate data with it via a grid or row.  When you define the field, you could 
choose a) how many bits of data you will be associating b) what the labels 
(keys) are for each c) formatting options (e.g. a horizontal row, or a bigger 
real-estate list of key/value pairs)?

What to call the second variation of this?  Meta?  Relation-meta?  

Storing JSON objects like this would require special output filters to provide 
users with "no-brainer" ways to print and format them in their templates.

Original issue reported on code.google.com by ever...@fireproofsocks.com on 29 Jun 2012 at 3:32

GoogleCodeExporter commented 9 years ago

Original comment by fireproofsocks on 9 Jul 2012 at 5:16

GoogleCodeExporter commented 9 years ago
"Tables" could be also called "Field Sets".

Original comment by ever...@fireproofsocks.com on 4 Sep 2012 at 4:59

GoogleCodeExporter commented 9 years ago
Issue 419 has been merged into this issue.

Original comment by ever...@fireproofsocks.com on 7 Oct 2012 at 4:09

GoogleCodeExporter commented 9 years ago
Attached is a field that associated some meta-data with the relation post ID.

Original comment by ever...@fireproofsocks.com on 31 Dec 2012 at 7:10

Attachments:

GoogleCodeExporter commented 9 years ago
Thinking more about this... Implementing "Field Groups" would accomplish this: 
you'd group together a relation field and some others (text, dropdown, etc.).  
It accomplishes the same idea as a join table, but the data structure is 
simpler -- all values could live in the postmeta table just as if you had 
manually added them.

Advantages: Using Field Groups would streamline the adding/removal of multiple 
fields to a post-type.  The data structure is simpler -- you could use 
get_custom_field() and print_custom_field() exactly as before.  No special 
output filters would be required.

Disadvantages: You would have to test to avoid double-adding: if text_field_X 
was already associated with a post-type, then you could not add field_group_Y 
to the post-type if text_field_X was a member of the group, lest you end up 
with 2 competing field elements.

The "Table" field might be deserving of its own data json structure and an 
output filter... but nobody has requested that functionality...

I wonder if it would make sense to offer additional formatting options to 
fields if they were members of a group.

Original comment by ever...@fireproofsocks.com on 1 Jan 2013 at 6:50

GoogleCodeExporter commented 9 years ago
The one extra bit here is when a group of fields becomes repeatable -- that 
would change the storage structure.

Original comment by ever...@fireproofsocks.com on 27 Feb 2013 at 4:46

GoogleCodeExporter commented 9 years ago
0.9.7.5: added RelationMeta field.  Field groups are going to be a similar 
beast.

Original comment by ever...@fireproofsocks.com on 15 May 2013 at 5:59

GoogleCodeExporter commented 9 years ago
Have there been any update on this? Interested in repeatable fieldset or Table 
fields. 

Original comment by corewebd...@gmail.com on 6 Mar 2015 at 6:42

GoogleCodeExporter commented 9 years ago
The RelationMeta field is probably as close as it will get for a while.  

Original comment by ever...@fireproofsocks.com on 6 Mar 2015 at 2:53