Drupal + Flex + Flare = Coolness
Posted by interfaced on February 20, 2008 at 10:12pm
Hey, I've set up a data pipe from Drupal to Flex/Flare using jQuery. Its as easy as this:
-
IN DRUPAL TEMPLATE.PHP
function phptemplate_views_view_list_{viewname}($view, $nodes, $type) {
foreach ($nodes as $i => $nid) {
$node = node_load($nid->nid);
$output[]= json_encode($node);
}
return 'var videos=['.implode(',',$output).']';
} -
IN THE HTML-TEMPLATE
<
script type="text/javascript">
function getData(){
$.getScript("http://example.com/view", function(){
/*$(videos).each(function(i){
