Products and more...
Hi,
I need some more functionality in my system then only a 'Product'.
How can I add a product that has;
1. a 'Product group' assigned to it
2. a relation with one or more 'Nutritional values' (many-to-many)
3. a relation with one or more 'Categories' (many-to-many) / no built-in taxonomies
Is this possible to build in Sitefinity? Including translations into different languages and maintenance in the backend?
Thanks,
Daniel
Hi Daniel,
For a project i'm currently developing, i have to manage 1 to many relationships and many-to-many relationships.
To do this, you must manage all your content in custom modules (like product catalog sample).
So in your case, you will create a custom module to manage Nutritional values (or do you want to use taxonomies?).
In the model of your product module, you will add a code like this:
private
TrackedList<Guid> nutrionalValues;
[FieldAlias(
"nutrionalValues"
)]
[DataMember]
[ReadOnly(
true
)]
public
TrackedList<Guid> NutrionalValues
get
if
(
this
.nutrionalValues==
null
)
this
.nutrionalValues=
new
TrackedList<Guid>();
return
this
.nutrionalValues;
set
var nv =
this
.NutrionalValues;
nv.Clear();
foreach
(var id
in
value)
nv.Add(id);
destination.NutrionalValues = source.NutritionalValues;
Hi Jocelyn,
Thanks for the explanation.
So how do you know when your dealing with a 1-n or a n-n relation? Is this something you can set?
I'll think I'll start with a Product module and a ProductGroup module...
Is it possible to have a menu item like 'Content' but then 'Products' and beneath this 'Products', 'Product groups' etc.?
Regards,
Daniel
Daniel,
I'm wondering if you was able to setup many-to-many relation between products and categories custom modules. I Think it should be implemented similarly to what ModuleBuilder does for "array of Guids" fields.
Denis.