cheesegrits
Support Gopher
OK. As long as we're on the same page, that I can't create the attributes. I can only set them from the existing options.
But it begs the question of how you want that mapping to be handled. I'm assuming you want it to be flexible, so you can add mappings of category to specific attributes, without having to edit the Javascript? Which would best be handled by having YAFT (Yet Another Table) which has something like:
category_pattern: field
attribute_id: join to attrbute table
... like ...
Beverage, 7 (ABV)
Hugh, 22 (Cheese)
Hugh, 23 (Grits)
Gifts, 3 (Gifts for her)
Gifts, 4 (Gifts for him)
... and the code could then simply be driven from that. Probably by having a little custom AJAX method to fetch the data, and load that up during page load.
And can you remind me why your original code is trying to set the attribute join element by label, rather than value? S0 "Gifts for her", rather than the PK of that row in the attributes table?
-- hugh
But it begs the question of how you want that mapping to be handled. I'm assuming you want it to be flexible, so you can add mappings of category to specific attributes, without having to edit the Javascript? Which would best be handled by having YAFT (Yet Another Table) which has something like:
category_pattern: field
attribute_id: join to attrbute table
... like ...
Beverage, 7 (ABV)
Hugh, 22 (Cheese)
Hugh, 23 (Grits)
Gifts, 3 (Gifts for her)
Gifts, 4 (Gifts for him)
... and the code could then simply be driven from that. Probably by having a little custom AJAX method to fetch the data, and load that up during page load.
And can you remind me why your original code is trying to set the attribute join element by label, rather than value? S0 "Gifts for her", rather than the PK of that row in the attributes table?
-- hugh
Last edited: