flare

Drupal + Flex + Flare = Coolness

public
interfaced - Wed, 2008-02-20 22:12

Hey, I've set up a data pipe from Drupal to Flex/Flare using jQuery. Its as easy as this:

  1. 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).']';
    }

  2. IN THE HTML-TEMPLATE

    function getData(){
    $.getScript("http://example.com/view", function(){
    /*$(videos).each(function(i){

Syndicate content