Scalar 2 User's Guide

Revealing individual authors in page headers

If you're creating a book with multiple authors, you might want to reveal the creator of each individual page up next to the page's title.  Place this Javascript snippet into the "Custom JS" box either on the individual pages, or globally in the Dashboard to make that happen (like it is at the top of this page):
$(document).ready(function() {
var author = $('header span[resource="'+location.protocol+'//'+location.host+location.pathname+'"]').next().find('[property="foaf:name"]').text();
$('h1:first').append('<small style="padding-left:14px;">by '+author+'</small>');
});

To instead place the page creator at the bottom of the main body text, pushed to the right and after an em dash:
$(document).ready(function() {
var author = $('header span[resource="'+location.protocol+'//'+location.host+location.pathname+'"]').next().find('[property="foaf:name"]').text();
$('[property="sioc:content"]').append('<br /><br /><span style="float:right;color:#888888;">— '+author+'</span>');
});