Customization 2.0

From SubjectsPlus
Revision as of 14:32, 8 August 2015 by Agdarby (Talk | contribs) (Created page with "SubjectsPlus was developed with the assumption that you wanted it to integrate as seamlessly as possible into your own site (rather than appear to be a standalone application)...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

SubjectsPlus was developed with the assumption that you wanted it to integrate as seamlessly as possible into your own site (rather than appear to be a standalone application). As such, the styling is deliberately "bare bones." To customize, or otherwise get SubjectsPlus to look like part of your site, you might try the following:

Basic Customizations

  • Customize the file subjects/includes/header.php to have your library's header
  • Customize the footer file, subjects/includes/footer.php
  • Tweak the css to look the way you want. The relevant files are default.css and guides.css. See CSS tips below.
  • Customize the "Search the Catalog" section of the subject display page to match your own library. The file is control/includes/classes/sp_Pluslet_5.php.
  • You might also want to customize the icons displayed in control/includes/classes/sp_Pluslet_5.php. This is what shows up in the Legend or Key to Icons box. Probably, you could go directly to control/includes/functions.php and customize the showIcons() function.

Customizing the Guide Types

By default, three guide types are set: Subject, Course, Topic. These three types will appear as options when you create a new guide, and will appear on the Research Guides splash screen.

If you want to change these, go to admin > config site. You will find a spot to modify the guide types. Keep in mind that if you change one of the existing types and there are already guides with this label, they will be orphaned. You will need to go to your SQL and update these, like,

UPDATE subject SET type = 'Widgets' WHERE type = 'Guide'

CSS Tips


The relevant file for styling the public site is sp/assets/css/default.css. The public files are in /subjects/ and /subjects/includes/ for the header and footer.

Version 2.0 is using bootstrap to allow for simple responsive layouts; bootstrap.css comes through the header, bootstrap.js is added in the footer. You can find out more about bootstrap on their site.

If you don't want to use bootstrap, go to admin > config and set Use Responsive Design to FALSE.

Boxes or Pluslets

Most of the public pages have the content chunked into boxes--which in olden times were known as "pluslets." They have the following form:

File:Pluslet structure.gif

Thus, to style it, you need to style





  • Note that the rounded edges on the pluslets WILL NOT appear in IE--they are CSS 3 features, which IE ignores. Should be okay in current versions of all the other browsers, and should degrade in IE to just regular boxes.

Custom Boxes/Pluslets: An Overview

The basic class for a box is sp_Pluslet.php, found in


This will plunk a box as described above onto a page. But it is generally extended for the different content types. These might be divided into two sorts: The ones with names, and the ones with numbers.

The Ones with Names

  • sp_Pluslet_Basic
  • sp_Pluslet_Feed
  • sp_Pluslet_Heading
  • sp_Pluslet_TOC
  • sp_Pluslet_Reserved_for_Special


A basic wysiwyg box (admin) to display content. As the title suggests, the most fundamental one. Links to records/FAQs/etc. elsewhere in SubjectsPlus can be attached through custom buttons in the second row of the WYSIWYG editor chrome.


Use to set up (admin) or display (public) feeds based on RSS/atom like Delicious tags, Twitter, RSS, Flickr, etc.


Just a title box (on the admin) that produces a little separator in the public page.


A table of contents for the boxes in the guide. You can select which items should show up in the TOC.


This is just a placeholder so you don't get an error message. A number of spaces in the pluslets table are reserved in case you want to develop your own custom pluslets.

The Ones with Numbers

  • sp_Pluslet_1 -- All Items by Source
  • sp_Pluslet_2 -- Key to Icons
  • sp_Pluslet_3 -- Subject Specialist
  • sp_Pluslet_4 -- FAQs
  • sp_Pluslet_5 -- Catalog Search Box (you need to localize this!)

These pluslets, unlike the named ones, are dynamic but uneditable by the librarian. So, while 1 will show all the records associated with a guide, the librarian just drags in this box to their guide and the appropriate items appear

Customizing the Search Box

There is a box to insert the catalog search form available when someone is creating a guide. If you hover over "New Box", you should see, among other things, a box called "Books: Use the Library Catalog":

File:Box types.png

To modify this, go to control/includes/classes/sp_Pluslet_5.php. Change the title to the text you want to display. Change the box to look/work the way you want.

Heading (sp_Heading.php), Key to Icons (sp_Pluslet_2.php), Subject Specialist (sp_Pluslet_3.php) are all candidates for customization.

Innovative Interfaces WebPAC Pro Customization Code

This code should go in the $this->_body variable in control/includes/classes/sp_Pluslet_5.php. You might need to customize it for your III implementation.

<!-- Modified for version by Bryan Carson on 2009-10-15 -->

<form action="" method="get" target="_blank" name="querybox" id="querybox" class="mainform" onsubmit="this.action = this.action + this.search_type.value;
 this.search_type.value= ''">
<br />
<strong>Search for</strong>

<input type="text" maxlength="800" size="25" name="search" class="search_smaller" />
<strong>in </strong>

<select name="search_type" class="search_smaller">
<option value="Y">Keyword</option>
<option value="t">Title</option>
<option value="a">Author</option>
<option value="d">Subject</option>
<option value="j">Genre</option>
<option value="c">LC Call Number</option>
<option value="h">Local Call Number</option>
<option value="g">Gov Docs Number</option>
<option value="i">ISBN/ISSN</option>

<input type="hidden" name="searchscope" value="2" />
<input type="hidden" name="searcharg" />
<input type="hidden" name="submit" value="Submit" />
<input value="Search MIDCAT" name="submit" type="submit" class="search_smaller" />
<input type="hidden" name="SORT" value="D" />


Customizing the ctags


The ctags are the little on/off flags which may be associated with a record in SubjectsPlus. You'll find them in a record under the Records tab. These flags, then, may be used by your public pages to group the records. So, you can add new ctags and then use this information to create any sort of subset of the collection you want.

Here's how the implement a new ctag:

Add new tag to listing in config.php

By default, the list of ctags is something like this:

File:Ctags image.jpg

you could just add a new one, then:

File:Ctags image cylon edition.jpg

So, we've added a new cylons flag, for items of which our new Cylon rulers might approve. At this point, the new ctag should appear in the record display, and the flag will be stored in the database.


If you tag something with "cylons" it will now show up under this heading on the Records browse page (once you click "cylons"). But it won't show on the public site yet.

Do something with the tag

For instance, make it show on the subjects/databases.php page. Find the getTableOptions() function at the bottom of this file. Add a code block like so

       case "cylons":
           $selection = "WHERE ctags LIKE '%cylons%'";

and now you can point people to databases.php?letter=cylons and get all the cylon-flagged records.


If you want to add "cylons" here, go to control/includes/functions and find the getLetters() function. Add in something like this to after the All is added (in a similar code chunk):

       $letterz[] = "cylons";
       if (!$selected) {
           $selected = "cylons";

Now it shows up. Cool.


Advanced Customization

More Customizations

Make the links in "All Items by Subject" appear in a new tab

Go to


and look around line 137. Add target=\"_blank\" to cases 1 and 3.

Show all subjects in dropdown on Record screen

By default, a librarian can only attach a record to a guide which they manage. If you trust your librarians--and who doesn't?--make them all show by going to control/includes/sp_Record.php around line 233. Change this line

 $subject_string = getSubBoxes(, 50);

to this to show all subjects

$subject_string = getSubBoxes(, 50, 1);

Make a new background for the Admin

Bored of the existing backgrounds as you slog in the SubsPlus admin day after day? You can fix that.

  • Find the $all_bgs array in the config.php file. Add a new item, say, "cylon" .
  • Go to assets/css and create a new css stylesheet with the same name, e.g., cylon.css. You can look at one of the existing stylesheets (e.g., metamorphosis.css) to see how minimal it can be
  • Boom you're done. It should appear as an option on the splash screen under "Background Options"