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.
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@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of DTH Sent: Monday, June 06, 2011 8:02 AM To: support@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.
In the .tpl.php file, you can do this easily. With the Custom Field module, you can add PHP, and do a row count.
Click on Theme Information or some such and then you will see all the .tpl.php files and it gives you the name to use and the default code also. You can just customize one of those.
F