Skip to content

Instantly share code, notes, and snippets.

@tsavory
Created June 8, 2012 19:41
Show Gist options
  • Save tsavory/2897763 to your computer and use it in GitHub Desktop.
Save tsavory/2897763 to your computer and use it in GitHub Desktop.
first attempt
<?php
/**
* Intergrates Flex Book web pages
*
*/
function flex_book_node_view($node) {
if($node->type == 'flex_book'){
$load_js = $node->field_load_js;//calls the field and makes it load.js
foreach($load_js['und'] as $js_file) { // gets the und from laod.js
drupal_add_js($js_file['value']);// loads the JS to the page
}
$load_css = $node->field_load_css;//calls the field and makes it load.css
foreach($load_css['und'] as $css_file) { // gets the und from laod.css
drupal_add_css($css_file['value']);// loads the CSS to the page
}
}
}
<?php
/**
* Intergrates Flex Book web pages
*
*/
function flex_book_node_view($node, $view_mode ) {
if($node->type == 'flex_book'){
$load_js = $node->field_load_js;
var_dump($load_js);
}
}
<?php
/**
* Intergrates Flex Book web pages
*
*/
function flex_book_node_view($node, $view_mode ) {
if($node->type == 'flex_book'){
$load_js = $node->field_load_js;
foreach($load_js['und'] as $js_file) { var_dump($js_file); }
}
}
<?php
/**
* Intergrates Flex Book web pages
*
*/
function flex_book_node_view($node) {
if($node->type == 'flex_book'){
$load_js = $node->field_load_js;//calls the field and makes it load.js
foreach($load_js['und'] as $js_file) // gets the und from laod.js
{ drupal_add_js($js_file['value']); }// loads the JS to the page
$load_css = $node->field_load_css;//calls the field and makes it load.css
foreach($load_css['und'] as $css_file) // gets the und from laod.css
{ drupal_add_css($css_file['value']); }// loads the CSS to the page
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment