dongshang1934 2011-05-20 17:02
浏览 59
已采纳

Drupal 6:使用视图在垂直HTML表格中显示数据

Iniside a view, I have a relationship set up between two tables: departments and employees. I want to use a view to display it in the following format:

Department A | Department B | Department C
 Employee 1      Employee 5     Employee 6
 Employee 2      Employee 7     Employee 8
 Employee 3
 Employee 4

But until now, using the grid and table style, I'm only able to display it as follow:

Department A 
 Employee 1   
 Employee 2   
 Employee 3
 Employee 4

Department B
 Employee 5  
 Employee 7

Department C
 Employee 6  
 Employee 8

I know I could create a module or a block for this but I would prefer to leave it inside a view and enable our client to change it whenever he wants to. How would you solve this requirement? Is there a view hook that would allow me to access the data and wrap my HTML table around it?

  • 写回答

1条回答 默认 最新

  • dongque3797 2011-05-21 05:54
    关注

    You can do it by making it "a view in a view". The basic view is a view of departments, set to display in a grid, with 3 grids per page. It will have 2 fields - department title field, and a field containing the view of employees. How do you put a view as a field? I suggest you use a Views Customfield module set to PHP and calling the list of employees with <?php views_embed_view($name, $display_id = 'default')?>;

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 深度学习残差模块模型
  • ¥20 两个不同Subnet的点对点连接
  • ¥50 怎么判断同步时序逻辑电路和异步时序逻辑电路
  • ¥15 差动电流二次谐波的含量Matlab计算
  • ¥15 Can/caned 总线错误问题,错误显示控制器要发1,结果总线检测到0
  • ¥15 C#如何调用串口数据
  • ¥15 MATLAB与单片机串口通信
  • ¥15 L76k模块的GPS的使用
  • ¥15 请帮我看一看数电项目如何设计
  • ¥23 (标签-bug|关键词-密码错误加密)