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:

  1. how possible access company's brands?
  2. 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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -