Skip to Main Content

In order to help minimize spread of the coronavirus and protect our campus community, Cowles Library is adjusting our services, hours, and building access. Read more...

Cowles Library

 

Librarians' Toolbox: Admin Tools

Sample code boxes, widgets, other useful stuff.

Admin Tools

This page contains code snippets, scripts and other advanced configuration tools. 

We suggest that you do not use the tools on this page without assistance from one of the Guides Administrators.

Andrew & Dan

Snippet to Suppress Breadcrumbs on a Single Page

Add the following style information to any box on the target page using, of course, the plain text editor.

<style>
.breadcrumbs {display:none;}
</style>

Note that this methodology works for any particular style elements we want to affect on a single page.  We can locate style classes on the Customizing the Look and Feel of LibGuides guide, particularly noting the Advanced Customization and Page Div Elements tabs.  There may be better sources -- this was what I used to solve the breadcrumbs display.

This can be used for "non-instructional" pages (Dean's site, student worker information, internal tutorials, etc.) -- anything that does not fit within the RG taxonomy and that will exist as a separate entity. 

 

Popup tooltip test

Turns out, a solution to creating our own tooltip-style popups was under our noses the whole time. The container LibGuides uses to hold "more information" popups exists on every page, it's just hidden. Let's use jQuery to hijack the container, tweak its style to accommodate a wider variety of content, and populate it with our own box content from other Research Guide pages.

Examples

How it works:

If created properly, the link holds all of the information we need to create the popup box content (except the popup width, which is set at 350px). The create a link that will display your Target Box in a popup, use the following values:

  • Link URL: The URL of the page on which the Target Box can be found. Caveats:
    • Make sure you copy the public version of the URL. In other words, it should contain "/content.php" instead of "/aecontent.php", and "mode=preview&" should be removed. It should look something like http://researchguides.drake.edu/content.php?pid=177426&sid=1493458.
    • The Target Box cannot be from another organization's LibGuide; the URL must begin with "http://researchguides.drake.edu/". If you want to use box content from another organization's LibGuide, see the LibGuide FAQ on copying a box from another system.
  • Link name: The ID of your Target Box, which can be found by viewing the HTML source of the page on which your Target Box is found. The ID should be a 7-digit number. You can use the Plain-Text Editor or the anchor icon in the Rich-Text Editor toolbar to insert this.
  • Link className: Give your link a class of "popcan". You may have to use the Plain-Text Editor to insert this. Without this className, the link will just load the URL specified in the Link URL, rather than opening a popup box.

Put it all together and you end up with a link that looks like this:

<a href="http://researchguides.drake.edu/content.php?pid=177426&sid=1493458" class="popcan" name="5103875">linky link link text</a>

This method can also be used to display individual elements from a Target Box within a popup, but we'll take it one step at a time. It is also possible to override the width by adding the width, in pixels, to the link name, separated by a comma (no spaces). Designate the width as a number only (ie, leave off the 'px'). For example "name='5103875,250'" to set a width of 250px. In my opinion, this knowledge should be shared only upon request, and for justified circumstances, as there's something to be said for a little consistency.

iFrame New Books

Chat test

RSS from Academic Search Ultimate

Loading ...