I made a custom nodetype for biblio author and it has authorID input_field ($node->field_bib_auth_id)
For a single page I can successfully insert the php snippet in the body like below :

include_once  drupal_get_path('module','biblio') . '/biblio.pages.inc';
print biblio_db_search("inline", "author",9);

for example the above authorID is 9

how to put code in template so the authorID can automatically get from input_field ($node->field_bib_auth_id)

the below code does not work

include_once  drupal_get_path('module','biblio') . '/biblio.pages.inc';
print biblio_db_search("inline", "author",$node->field_bib_auth_id);

I know very few about php

Comments

reprabowo’s picture

additional infom i wish to have $node->field_bib_auth_id from default biblio authorID

reprabowo’s picture

Component: Miscellaneous » Code
Assigned: reprabowo » Unassigned
reprabowo’s picture

Title: Insert athor ID » Insert author ID
rjerome’s picture

You might try

$node->field_bib_auth_id[value][0]

reprabowo’s picture

rjerome... it does not work

rjerome’s picture

opps, I think I had that backwards... it should have been
$node->field_bib_auth_id[0]['value']

If you want to do a little crude debugging, you could always just add the following before you call biblio_db_search()...

var_dump($node); die;

Then you will see exactly what the node object looks like. Post it here if you want.

liam morland’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

This version is no longer maintained. If this issue is still relevant to the Drupal 7 version, please re-open and provide details.