In my Drupal 7 site I use the Printer, email and PDF versions module. I want to show the printer link on some specific pages of a specific content type. So I have enabled the link in that content type, which include a boolean field (field_printable) where the admin should be able to choose to include the link or not. In my template.php file I try to figure out how to work this out. This is what I have got so far in my template.php file:
function mytheme_preprocess_node(&$variables) {
if($variables['type'] == "mycontenttype"){
// boolean field that returns 1 if checked
if($node->field_printable['und'][0]['value'] == 1){
what to put here ...?
}
}
}
I should probably use print_insert_link(); to insert the link, but I cannot figure out how. Can anyone point me in the right direction? I have spent hours googling on similar questions, but I am stuck right now.
Any help would be very appreciated, thanks in advance.
Edited: Screen goes blank after I try this...
function mytheme_preprocess_node(&$variables) {
if($node->nid == 408){
$variables['print_custom_link'] = print_insert_link();
}
}
I also added this in my node template file:
print render($content);
if(!empty($print_custom_link)){
print render($print_custom_link);
}