# - ebook_id: external ID for title (ISBN for OneClickdigital, unique identifier for OverDrive)
# - vendor (oneclickdigital, overdrive)
-IF args.ebook_test_id;
- ebook.ebook_id = args.ebook_test_id;
- ebook.vendor = 'ebook_test';
-ELSIF args.oneclickdigital_id;
- ebook.ebook_id = args.oneclickdigital_id;
- ebook.vendor = 'oneclickdigital';
-ELSIF args.overdrive_id;
- ebook.ebook_id = args.overdrive_id;
- ebook.vendor = 'overdrive';
-END;
-
-IF ebook.ebook_id;
+IF args.ebook;
IF ctx.page == 'rresult';
ebook.rec_id = rec.id;
ebook.rec_id = ctx.bre_id;
END;
+ ebook.ebook_id = args.ebook.ebook_id;
+ ebook.vendor = args.ebook.vendor;
+
# This div is hidden by default. The JS layer will unhide it, use the ebook_id
# to retrieve holdings/availability info via the appropriate vendor API, and
# overwrite the div's contents with that information.
END;
args.bibid = args.bibid.0;
+ IF args.ebook_test_id;
+ args.ebook.ebook_id = args.ebook_test_id;
+ args.ebook.vendor = 'ebook_test';
+ ELSIF args.oneclickdigital_id;
+ args.ebook.ebook_id = args.oneclickdigital_id;
+ args.ebook.vendor = 'oneclickdigital';
+ ELSIF args.overdrive_id;
+ args.ebook.ebook_id = args.overdrive_id;
+ args.ebook.vendor = 'overdrive';
+ END;
+
END;
# Get the library or location group