newcoder1010 Posted April 1, 2015 Share Posted April 1, 2015 Hi, I am using drupal. Template.tpl.php I have a function function bartik_preprocess_print(&$vars, $hook) { // Global node. $node = $vars['node']; $vars['price'] = field_view_value('node', $node, 'field_price', $node->field_price[$node->language][0]); $vars['vehicleOption1'] = field_view_value('node', $node, 'field_vehicle_option_1', $node->field_vehicle_option_1[$node->language][0]); } in print.tpl.php, I have print render($test); print render($vehicleOption1); But I am only getting the one value and it is the value of $vehicleOption1 Can you please help as for how I can values from the both variables? Thanks, N Link to comment Share on other sites More sharing options...
justsomeguy Posted April 1, 2015 Share Posted April 1, 2015 How are the bartik_preprocess_print and render functions related? Link to comment Share on other sites More sharing options...
newcoder1010 Posted April 1, 2015 Author Share Posted April 1, 2015 Sorry, I don't know how they are related. All I can template.tpl.php and print.tpl.php in two different directories. If I just have one variable in template.tpl.php file as $vars['price'] = field_view_value('node', $node, 'field_price', $node->field_price[$node->language][0]); I can see the value by writing the below code in print.tpl.php file print render($price); I just need to know how I can declare the 2nd variable in the template.tpl.php file? Thanks. Link to comment Share on other sites More sharing options...
justsomeguy Posted April 1, 2015 Share Posted April 1, 2015 I don't have enough experience with Drupal to say, although there should be plenty of documentation for it online. Link to comment Share on other sites More sharing options...
Techneut Posted April 10, 2015 Share Posted April 10, 2015 You can find many info and tutorials at https://www.drupal.org/documentation/customization/tutorials Link to comment Share on other sites More sharing options...
najib Posted April 10, 2015 Share Posted April 10, 2015 ok i'm using drupa 7 too you must add a new $vars['test'] in the precess_print function or maybe you can decalare any vaiables in template.php inside your_theme_preprocess_page function and call it in template/youtempate.tpl.php that's the way that i use maybe you can find something better Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now