Posted by kotoba on June 28, 2012 at 12:57am
Hello everyone,
I hope this is the right place, but I am new to Drupal/Openscholar and have a (minor) question regarding the publication content type.
Basically I would like the "Book cover" field to appear in all publication subtypes.
I tried editing the Biblio content type, but I found that the "Book cover"/biblio_image field is included in all form variants, so supposedly it should appear in all publication sub-types. On the other hand, the field doesn't show up on the Biblio module administration page at all.
I would appreciate if someone could assist me in making the cover availabe for all publication types.
Thanks a lot!
Comments
Kotoba,I don't believe you
Kotoba,
I don't believe you can make this change through the admin pages - you'll have to do it through code.
Check out sites/all/modules/openscholar_features/scholar_publications/scholar_publications.module. The scholar_publications_form_alter() function adds the book cover field to some biblio types but not all. I believe types 100 and 101 are book and book cover, so the in_array() at the end of the first if is checking whether the publication is of either of those types. So changing
if ($form_id == 'biblio_node_form' && array_key_exists('field_biblio_image',$form) && in_array($form['biblio_type']['#default_value'], array(100,101))){
to
if ($form_id == 'biblio_node_form' && array_key_exists('field_biblio_image',$form) ){
should get rid of the biblio type check.
Hope that helps.
Jon
thank you - suggestion
Thank you! That helped. While at it, I also changed the publication types for which the external URL (biblio_url) is shown in the teaser - I found it a little counterintuitive that it isn't shown by default for "Website" type publications...
Wouldn't these settings be be better handled through the admin interface, though, since there already are a lot of options for setting certain fields and mapping them to publication types? I don't know how much work that would be but I think would make adjusting biblio settings more consistent and convenient. Just a suggestion.
Again, thanks a lot for your help!