Skip to content

Instantly share code, notes, and snippets.

@kratkar
Created October 12, 2011 15:42
Show Gist options
  • Save kratkar/1281562 to your computer and use it in GitHub Desktop.
Save kratkar/1281562 to your computer and use it in GitHub Desktop.
Get webform submissions data from node id(add in node-<nid>.tpl.php)
<?php /**
* add in node-<nid>.tpl.php
* see http://drupalcode.org/project/webform.git/blob/HEAD:/includes/webform.submissions.inc#l610
* output webforms submissions, pager name 'page'
*/
if (isset($_GET['page']) && is_numeric($_GET['page'])) {
$pager_count = $_GET['page'];
}
$subms = webform_get_submissions(array('nid' => $node->nid), NULL, $pager_count);?>
<ul class="list">
<?php foreach($subms as $sm):?>
<li class="item"><?php print $sm->name?></li>
<?php endforeach; ?>
</ul>
<?php
//for debug install devel & use of the dsm and dpm functions
//uncomment botom line
//dpm($subms);
//dsm($subms);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment