Thanks for your patience during our recent outage at scalar.usc.edu. While Scalar content is loading normally now, saving is still slow, and Scalar's 'additional metadata' features have been disabled, which may interfere with features like timelines and maps that depend on metadata. This also means that saving a page or media item will remove its additional metadata. If this occurs, you can use the 'All versions' link at the bottom of the page to restore the earlier version. We are continuing to troubleshoot, and will provide further updates as needed. Note that this only affects Scalar projects at scalar.usc.edu, and not those hosted elsewhere.
How to Use Scalar: Digital Publishing for Libraries, Archives, and Museums
Main Menu
About This Project
About the creators and purpose of this project
What Is Scalar?
A brief introduction to what Scalar can do as a platform.
Scalar in Libraries, Archives, and Museums
Why Scalar is a relevant tool for librarians and other information professionals to learn.
How to Use Scalar
Step-by-step instructions for creating your first Scalar book.
More Resources
Annotated list of resources with more information on using Sclar
Paige Szmodis
c78c538ae17b32016e9167236f1aa8c213efc288
Elizabeth Swihart
2a47b61d624c2ba01890fc87ecc1d0c25d5107a3
Shenwei Chang
5f647018e81e72f2978f28d4dfbea5d53d6dd876
Screenshot of Styling tab in page editor
1 media/Screenshot showing CSS option under Styling_thumb.png 2021-03-20T16:59:36-07:00 Shenwei Chang 5f647018e81e72f2978f28d4dfbea5d53d6dd876 38779 2 Screenshot showing the Styling tab in the page editor plain 2021-03-20T17:00:15-07:00 Shenwei Chang 5f647018e81e72f2978f28d4dfbea5d53d6dd876This page is referenced by:
-
1
2021-03-18T02:37:44-07:00
Using CSS
16
How to use CSS to customize the appearance of your book
plain
2021-03-21T08:14:07-07:00
If you want to change the appearance of your book from the default settings, you can use the custom CSS functionality to override the defaults.
The CSS can be customized so that the changes are reflected across the entire book, or you can customize the appearance of a particular page.Customizing the Book
- To customize the CSS for the entire book, go to the dashboard by clicking the wrench icon.
- When the dashboard loads there should be a tab labeled Styling. Click on that tab.
- Under the Styling tab there should be a section labeled custom CSS. You can type any CSS code directly into the input field without enclosing it in HTML
<style>tags. - You can also insert predefined CSS provided by Scalar by using the dropdown menu below the main CSS code field. Select the desired option and click the “Insert” button.
- The code should appear in the Custom CSS code field. Make sure to save your CSS using the “Save” buttons at the bottom of the page.
Customizing a Page or Element
- To customize the CSS for a particular page or element, open the editor for the page and click on the Styling tab underneath the text editor field. Locate CSS on the dropdown menu and click on it.
- The area under the tabs should refresh to show a CSS input field. As with the CSS input field for the entire book, the CS input field here can also be used without making use of the HTML
<style>tags. - You can also insert predefined CSS using the dropdown menu. Select the desired option and click “Insert.”
- The code should appear in the Custom CSS code field. Make sure to save your CSS using the “Save” buttons at the bottom of the page.
For more tips, check out the Scalar 2 user guide for how to alter the CSS. For those who are familiar with HTML and CSS, further experimenting is encouraged. CSS changes applied to pages that are paths will also apply to the other pages on the same path. Be sure to use the correct selectors for page-specific elements to avoid unwanted aesthetic changes in other parts of the book. -
1
2021-03-18T02:38:16-07:00
Using JavaScript
6
How to use JavaScript to customize your book
plain
2021-03-20T20:51:26-07:00
JavaScript can be used to add certain features or elements that are usually hidden on a page or not displayed, among other things.
Page-Specific JavaScript
- To add JavaScript customization to a page, click the pencil icon to open the editor, go to the Styling tab in the editor page, and select the JavaScript option. This should refresh the page with a JavaScript code field
- Type or paste any JavaScript code into the field.
- Click one of the "Save" buttons at the bottom.
JavaScript for the Entire Book
To add JavaScript that will apply to the entire book, go to the dashboard, click on the Styling tab, and scroll down to the JavaScript code input field. Follow steps 2-3 from the Page-Specific JavaScript tutorial above.Adding bylines
If you want to insert an individual byline for a particular page, you can use the code snippet provided by the Scalar 2 User's Guide:
$(document).ready(function() { var author = $('header span[resource="'+location.protocol+'//'+location.host+location.pathname+'"]').next().find('[property="foaf:name"]').text(); $('h1:first').append(' by '+author+''); });
Below you can see where the byline should appear. The name displayed will be that of the user who added the page to the book.If the person who created the content of the page is different from the person who added the page, you can use the following code-snippet instead:$(document).ready(function() { $('h1:first').append(' by FirstName LastName'); });
Substitute the person's name where it says "FirstName LastName."
For more information about using JavaScript, consult the Advanced Topics chapter of the Scalar 2 User's Guide.