orchardcms - Taxonomies relation -
we new orchard. , we've created 3 taxonomies company, brand , model. brand has company field , model contains brand. now, defining contenttype named car has brand , model fields , in view:
@* shape displays term , content items associated it. *@ @{ model.contentitems.classes.add("content-items"); } @display(model.contentitems)
we can company's logo this:
model.contentitem.companyterm.companylogo
2 questions:
- how possible access company's brands?
- and having brand how can retrieve brand's cars.
first, please aware there high potential select n+1 squared issues here.
your company terms content items, can parts , fields. should work if taxonomy field brands called brands
, attached part same name term's type:
model.contentitem.companyterm.companyterm.brands.terms
each of terms content item, in same way, , if cars taxonomy field called cars
on part named brandterm
on brand taxonomy term type, should list of cars:
brandterm.brandterm.cars.terms
Comments
Post a Comment