[support] Adding an optional row to a View

Joel Willers joel.willers at sigler.com
Mon Jun 6 14:43:06 UTC 2011


In the .tpl.php file, you can do this easily.  With the Custom Field module, you can add PHP, and do a row count.  

Also, you could do an attachment so that the main view shows five things with a footer, and then an attachment that shows the next five things with a footer.

If it were me, I’d use the .tpl.php.

Hope that helps,

Joel

From: support-bounces at drupal.org [mailto:support-bounces at drupal.org] On Behalf Of DTH
Sent: Monday, June 06, 2011 8:02 AM
To: support at drupal.org
Subject: [support] Adding an optional row to a View

I have a view that works fine. It outputs a table with four columns in, one of which is a unique id. After some rows (which I know the id of), I'd like to add an extra row beneath. After row id 5, say, it would be <td colspan='4'>some text</td> and after row 10 <td colspan='4'>different text</td>.

I know this is a bit of a pain of a requirement. Is there any way to do this in Views 2? I'd much rather use Views than hack up some custom code that does a db_query and loops through etc etc.


More information about the support mailing list