On my site, content type Lead has field Rating (1-5). Content type Recruiter also has field Rating (1-5).
I want to have a specific "display": a list of Leads, sorted by rating, where equal-rated leads are grouped, and the group is labeled and collapsible via jQuery.
I have implemented this by creating 5 custom blocks of a view, each block selects leads rated 5, leads rated 4, ... and then I put the blocks on a page, via layout, and override block--views-block--rated-lead-block-1.html
, block--views-block--rated-lead-block-2.html
, ... for the total of 5 template files, to allow each rating to be collapsible via jQuery.
Well, this isn't very portable. And what if I want to have the same view for the Recruiter, not just the Lead? I don't want to create 5 template files for this for Recruiter content type, because what happens if I created another rated content type?
It seems, what I want is, instead of unformatted list, create another formatter, call it RatedItems or whatever, where I override the template file once, and the template renders all the 5 ratings, labeled and collapsible, regardless of the content type.
Is there a way to create a formatter? My available formatters are: grid, html list, table, unformatted. I want to add one more: RatedItems, and write a template for it. Is that possible?