Conditional Branding
  • 10 Jan 2025
  • 3 minute read
  • Dark
    Light
  • PDF

Conditional Branding

  • Dark
    Light
  • PDF

Article summary

This article provides a general overview and examples of conditional branding in Slate. We strongly recommend having one consistent branding for your entire instance.

🔔 Important!

  • The implementation of conditional branding falls outside the scope of Support Desk assistance.

  • Due to its inherent complexity and uniqueness to each institution, we cannot help you develop, implement, or fix behavior related to conditional branding. It is incumbent on your institution to implement, troubleshoot, and maintain any custom conditional branding.

General recommendations

Keep it simple. Get default branding in place first, then work on iterations.

For a number of reasons, conditional branding should not be excessively complex. We recommend making simple adjustments, such as swapping a different image or logo or adjusting a footer or header.

Like many aspects of Slate, we encourage you to thoroughly test to ensure that the branding works as expected before bringing the change into Production. We recommend using the Branding Editor to conduct testing. The Branding Editor tool enables the editing and previewing of Slate branding while keeping the current branding files unchanged. It provides previews of how branding would look for a specific record or URL.

Once you start putting conditional branding into place, all necessary information may not be available at various spots, so we recommend thoroughly testing and including defaults in conditionals. Again, remember that this use of conditionals is outside the scope of Support assistance.

Best Practice

Conditional branding misbehaving? We recommend using Version History in Files to roll your branding back to the last time it appeared as expected.

There are many ways to approach conditional branding. The following examples are provided to demonstrate what is possible.

Adding the fw namespace

Slate branding employs a templating language called Extensible Stylesheet Language Transformations (XSLT).

📝 Note: We recommend, at minimum, building working familiarity XSLT, HTML, CSS, and JavaScript before you attempt any conditional branding in Slate with these tools.

Slate makes use of a custom XSLT Namespace called fw. To access many of the variables discussed in this article, the fw namespace must be included in the xsl:stylesheet element at the root of your branding document:

<xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:fw="http://technolutions.com/framework" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="xhtml">

Conditional branding for an application

We recommend Choose and Contains statements over If statements in your conditional branding because If statements can cause loopholes. For changes based on application, we recommend using the Round Key. For example, your institution might have different logos that appear based on Round Key. Here the Rounds are UG and GR, and each program has a corresponding image.

  1. In the main Slate navigation, click Database.

  2. In the Configurations section, click Files.

  3. On the right side of the page, locate and click shared.

  4. From the list of files, locate and select the line that includes build.XSLT. The Edit File tool opens.

  5. Create an XSL variable called roundKey to act as a reference for the rest of the page:

<xsl:variable name="roundKey" select="*/fw:template/@application-roundKey" />
  1. In the appropriate place in your HTML, add code that selects the correct image based on round-key. This code may look something like the following:

<xsl:choose>
       <xsl:when test="(contains(fw:pathAndQuery(), '/apply') and $roundKey = 'UG')">
            <img src="/images/sample-A.jpg" alt="Home" class="cr" style="logo-image" />
       </xsl:when>
        <xsl:when test="(contains(fw:pathAndQuery(), '/apply') and $roundKey = 'GR')">
            <img src="/images/sample-B.jpg" alt="Home" class="cr" style="logo-image" />
        </xsl:when>
            <xsl:otherwise>
                <img src="/images/sample-default.jpg" alt="Home" class="cr" style="logo-image" />
            </xsl:otherwise>
  </xsl:choose>

📝 Note: Applicants will only see application-specific conditional branding once they've started an application and established a round key.

Conditional branding for a form

Our recommended best practice is to embed forms on pages or domains with the desired branding and not utilize conditional branding. If you were to go forward with conditional branding, you could use the form's path.

For example, if you want to display some additional text on your inquiry form page, your code may look something like this:

<xsl:choose>
   <xsl:when test="contains(fw:path(), '/register/inquiry')"> You are on the inquiry page!
   </xsl:when>
   <xsl:otherwise>
   </xsl:otherwise>
</xsl:choose>

Other variables

Other XSL variables—apart from roundKey and path—can be created by calling functions in the Framework library (fw:). For reference, here are some others:

  • query('param'): Returns the value of the specified query string parameter.

  • url(): The full URL of the request. For example, https://apply.slate.university.edu/apply/status?cmd=submitted

  • https(): The subdomain used by an instance. For example, https://gradadmissions.slate.edu

  • config(key): Get the value of any config key set for the instance.

  • fw:year(): Returns the current year (for example, for copyright end years)


Was this article helpful?