Result of custom sql query needs displayed in table format. The custom query unifies results from two entities (which is not possible through views UI) and creates an html table.

A settings form needs to be created that would provide an ability to

  1. Hide/show all available columns in this table.

  2. Provide an ability to customize the display formats for each column in # 1 (for example time in different formats, description trimmed or full, etc). This will be similar to Manage Display UI

How can #2 be accomplished programmatically? Essentially replicate Manage Display like capability on a custom settings form.

Should this table, instead be generated using views which inherently provides hiding/formatting options via Views UI? If so, how can the views query be supplanted by the custom query which merges and unifies two entities?

Also like to avoid using Display Suite module and stick to core modules.

  • If you want to make use of views module, the most simplest way is to define custom entity for your tables. – Jimmy Ko Aug 10 '16 at 0:58
  • The entity already has field exposed to the views, but since the custom query unifies two entities views does not work out of the box. I have started another question to create view programmatically as I already know the query. drupal.stackexchange.com/questions/215423/… – amit Sep 21 '16 at 2:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.