Created
June 8, 2012 19:41
-
-
Save tsavory/2897763 to your computer and use it in GitHub Desktop.
first attempt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); } | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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