I want to setup a View that will display all Title's within the company in a certain way.
History (not sure if necessary, but I imagine it can't hurt): I had a lot of duplicate Title's, because I grab the title from the user node, no distinct features seemed to help. I found a way of using hook__query_alter(QueryAlterableInterface $query)
to make sure the titles were in order and they were not duplicated. If I display the View, as is, as a table, it looks like a normal list:
But I want the table to look like the following:
Can I do this without code? No idea how, If I can't, which is fine, my real question is below:
I can grab the view in template_views_pre_render(&$view)
, I noticed I can also snag some of it in the hook_preprocess_views_view(&$vars)
, and I can grab pieces in the template (...tpl.php) files like views-view-field-w/e.tpl.php
and views-view--w/e.tpl.php
. But as it stands I really don't know where to begin my algorithm and sifting through. In order to do this I imagine I build 3 arrays, array A, B, and C (eventually also D, E, F, etc.) and just spit them out in one of the template files to build rows for each alphabetical column in a table structure, but where do I build these arrays up, I hear preprocess
hook is where it might be done? If so, how do I hand them over to the template files (stuff them back into the views array?). If I shouldn't be doing it that way, should I just build up my arrays and spit them out in the table format all in the template files?