Tech Blog

Change label displayTag font in WebVoyage to make field more visible

Introduction.

 

This blog post provides a fairly simple way to change the font color and type for a WebVoyage field tag in order to make it more visible in the record display. 

In this example we change the “Links” field tag to “ONLINE ACCESS”, plus we change the font color to red and the font type to Italic (see screenshot example at the bottom of this blog post).

This blog post assumes you have your 856 links cataloged in your Bibliographic Record.

It also assumes that you have some skill in editing xml and xsl files, and understand the basics of how they work.

You will need to make changes to two files in your WebVoyage skin.  They are:

  1. displaycfg.xml
  2. display.xsl

Always remember to backup any file before changing it, and to test all changes in all available browsers, and on several PCs.

Grateful acknowledgement is made to others whose skills, talents and willingness to share contributed to this blog post.  The code is supplied “as is” and is confirmed to be working in Voyager version 10.1.

 

STEP 1.

Edit the displaycfg.xml file.

Change the field tag from this:

</displayTags>
<displayTags label=”Links:”>
<displayTag field=”3000″/>
</displayTags>

To this:

</displayTags>
<displayTags label=”ONLINE ACCESS:”>
<displayTag field=”3000″/>
</displayTags>

 

Save your changes.

 

STEP 2. 

Edit the display.xsl file. 

Locate this section:

<xsl:template name=”outputDisplayData”>

<xsl:param name=”displayData”/>

 

        <xsl:choose>

 

            <xsl:when test=”string-length($displayData) and displayTag/@field=’9000′”>

                    <div class=”holdingsLabel”>

                        <xsl:choose>

                            <xsl:when test=”string-length(@label)”>

                              <!–

                                <xsl:value-of select=”@label”/>

                                –>

                                <h3 class=”orange_tb”><xsl:value-of select=”@label”/></h3>

                            </xsl:when>

                            <xsl:otherwise>

                                 

                            </xsl:otherwise>

                        </xsl:choose>

                    </div>

                    <xsl:copy-of select=”$displayData”/>

            </xsl:when>

 

            <xsl:when test=”string-length($displayData) and displayTag/@field=’9500′”>

                <div class=”holdingsSummaryLabel”>

                    <xsl:choose>

                        <xsl:when test=”string-length(@label)”>

                            <h3 class=”holdingsSummaryHeading”>

                                <xsl:value-of select=”@label”/>

                            </h3>

                        </xsl:when>

                        <xsl:otherwise>

                                 

                            </xsl:otherwise>

                    </xsl:choose>

                </div>

                <xsl:copy-of select=”$displayData”/>

            </xsl:when>

 

            <xsl:when test=”string-length($displayData)”>

                <!–div class=”fieldLabel”–>

                    <span class=”fieldLabelSpan”>

                        <xsl:choose>

 

Replace this next line:

<xsl:when test=”string-length(@label)”>

 

With this code:

 

                            <xsl:when test=”string-length(@label) and displayTag/@field=’3000′”>

 

<i><font color=”red”>

<xsl:value-of select=”@label”/>

</font></i>

                            </xsl:when>

                            <xsl:when test=”string-length(@label) and not(displayTag/@field=’856′)”>

 

Save your changes.

 

Step 3.

Test your changes.

You should see something like this:

 

 

Additional Information.

You can of course choose whatever color or font type you wish the tag to display in.  In this example we use the color red and font type of Italic.

Leave a Reply