1

i am building a lists plugin .... i want to have a custom post type "lists" and then obviously also there would be a number of list items for each list .... i have read a fair bit of stuff about taxonomies vs postmeta but i'm still unsure as to which i should use or maybe something else ... it seems taxonomies are really more for categorising things ( like taxonomy colour, group etc ) and postmeta is more for attributes associated with a post eg ( url, phone number, price etc ) .... so it would seem that list items should be postmeta data, but my problem is that i want to have unlimited list items in the same way you could have unlimited taxonomy terms however is postmeta suitable for this .... it doestn look to me like something you'd create a new one of on the fly.... any comments ..... or maybe i should be doing it a different way altogether

also i will need to be able to somehow group list items also and do a couple of other things with them eg sorting them via ajax (drag and drop)

0

2 Answers 2

2

Lists of items are already implemented in WP core. They're called custom menus. They are stored as a custom post type + taxonomy.

UPDATE:

I had assumed that your list items would be other posts, but I'm getting the impression that you just need them to be strings. In this case, menus would be overkill and you should store the list items as individual custom fields.

8
  • not sure what your taliking about - how could i use custom menus for this - custom menus are for providing front end access to pages/posts etc --- what i want is completely different - i will have a custom post type "lists" and then i will create eg list#1, list#2 and i will want to add list items to these lists .... apologies if im wrong but i fail to see how custom menus could possibly help, thanks anyway though Commented Jun 26, 2011 at 20:28
  • "I will create eg menu #1, menu #2 and i will want to add menu items to these menus." How is it "completely different"? Anyway, you didn't describe what the lists are for.
    – scribu
    Commented Jun 26, 2011 at 20:30
  • they're just lists .... like a shopping list - or a list of videos in my collection ..... anything .... but there could be 100 items or more in a lists - sorry i cant see how or why i'd do it with menus Commented Jun 26, 2011 at 20:39
  • 1
    As long as you store list items in individual postmeta rows, you should be fine. You're on your own on the interface part, though. Shouldn't be too hard.
    – scribu
    Commented Jun 26, 2011 at 22:07
  • 1
    @byronyasgur let us continue this discussion in chat
    – scribu
    Commented Jun 26, 2011 at 22:08
2

The grouping would be the best fit for the taxonomies. The drag and drop can be achieved pretty easily. I've got a set of functions (including JS and CSS) you can see it all here http://pastie.org/2125914

As for the list content, postmeta would be the way to do it, but I haven't seen an "add on the fly" solution yet. I'd be interested in that myself.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.