Skip to main content
pdf?stylesheet=default
Blackboard Help

Express Design Common Variables

Express design variables are used to dynamically add information to the Express design files, such as header.html, footer.html and core.css. When the Express theme loads an Express design file, the variables are replaced with the data from Moodle that they represent. For example, the %WWWROOT% is replaced with the base URL for the site – usually http://<client name>.mrooms.net.

This page includes a listing of all Express design variables. These variables can also be used in an Express template, but their values are not replaced until the Express theme reads the design files. The list is grouped by where the variable is typically used. Some variables can only be used in the header.html or footer.html.


Navigation variables

  • %BREADCRUMB%: Renders the breadcrumb line, which shows the user where s/he is on the site, along with the Turn editing on button and the Switch role to... menu based on the user’s permissions.
  • %DOCLINK%: Renders the core Moodle help doc links, which usually point to docs.moodle.org
  • %EXPRESSMENU%: Renders the menu.html file and the JavaScript necessary to convert it to a YUI menu
  • %HEADERID%: Used to add a dynamic ID attribute for a div tag. Values are “header,” “header-home,” or “header-none,” depending on where the user is within the site.
  • %HEADING%: Renders a value in the heading variable (usually this is the full name of the site)
  • %HOMELINK%: Renders the Home button, which sends the user back to the home page. The application determines the pages on which this button is displayed.
  • %LANGMENU%: Renders the Choose a language drop-down menu, allowing the user to select the interface display language. This requires that the manifest.xml file has the layout tag for the layout that will display the language menu:

    &lt;options&gt;langmenu=true&lt;/options&gt;

  • %LOGGEDINAS%: Renders only the You are logged in as area without the language menu selector.
  • %MENU%: Renders the Choose a language menu, You are logged in as text, and links to log in to the site. Renders the Jump to menu in an activity. This requires that the manifest.xml file has the layout tag for the layout that will display the language menu:

    &lt;options&gt;langmenu=true&lt;/options&gt;

  • %MRHELPLINKS%: Links to the support site.
  • %PERFORMANCEINFO%: Renders the performance information on page load time and database queries
  • %SWITCHTHEME%: Prints a switch to Mobile theme or full site when a user has accessed the site from a mobile browser.
  • %SWITCHROLE%: Prints a return to role or login as user's name when a user has switched their role or logged in as another user receptively.
  • %VALIDATORS%: Renders the links to the HTML validations for the application.

Block region variables

Region variables display the blocks and their content that have been assigned to that region. For region variables to work the region must be added to the Express design's manifest.xml file within a region tag, which is part of the layout tag. If a region is not set for the layout within within the manifest.xml file then the Express design block region variable will not display blocks for that region.

  • %BLOCKREGION1%: A custom block region that can be placed anywhere within the layout's structure. This allows clients to customize their layouts in new and unique ways.
  • %BLOCKREGION2%: A custom block region that can be placed anywhere within the layout's structure. This allows clients to customize their layouts in new and unique ways.
  • %BLOCKREGION3%: A custom block region that can be placed anywhere within the layout's structure. This allows clients to customize their layouts in new and unique ways.
  • %BLOCKREGION4%: A custom block region that can be placed anywhere within the layout's structure. This allows clients to customize their layouts in new and unique ways.
  • %MAIN%: Used for the center column of the flexpage layout file and can be repurposed in other layouts as well as a custom block region.
  • %MAINCONTENT%: The main content on a course page, usually the center column, that contains the activities and resources.
  • %SIDEPOST%: The right hand block region for most layout files. This is a standard region.
  • %SIDEPRE%: The left hand block region for most layout files. This is a standard region.
  • %SIDETOP%: The top block region on a flexpage layout. This can be used to add a top block region to any other layout file too.

Course variables

  • %ACTIVITYNAVARROWS%: This displays previous and next arrows that are linked to the previous and next activities in the course based on the activities location in the course sections. This should be used in the incourse.html only. Required the activity navigation arrows filter be turned on by Moodlerooms and enabled for the site.
  • %COURSEACTIVITIESYUI%: Create a YUI menu of all the sections and the activities within each sections. This is best used in the Express menu but can be used by itself if a developer understands how the YUI menu works. Allow Course Activities Custom Menu must be set to “Yes” in the Express site settings for this variable to work.

    This feature could cause performance issues with a large number of courses.

  • %COURSEFULLNAME%: Renders the full name of the course that the user is currently in.
  • %COURSEID%: Renders the course's ID number. This should be used to create dynamic links to the course, module, block or user profile.
  • %COURSESHORTNAME%: Renders the short name of the course that the user is currently in.
  • %COURSESUMMARY%: Renders the course summary.
  • %COURSEVISIBLE%: Returns the value 1 if the course is set to be available to students otherwise it returns 0.
  • %COURSEHEADER%: Displays the course header for the course format if the course format has set it.
  • %COURSECONTENTFOOTER%: Displays the course content footer for the course format if the course format has set it.
  • %COURSECONTENTHEADER%: Displays the course content header for the course format if the course format has set it.
  • %COURSEFOOTER%: Displays the course footer for the course format if the course format has set it.
  • %CUSTOMIMAGE%: Renders the logo that has been uploaded to the site, category or course via the Express block's Create a Design tab.

  • %JOULEGRADERLINK%: A link to the Joule grader based on where the user is in the course (course or activity) along with the language string for Joule grader.
  • %GRADELINKSLIST%: All grader report links the user has permission to view.

Flexpage variables

  • %FPPREVIOUSBUTTON%: Prints the previous button if the flexpage is configured to display it and has a flexpage after the current flexpage in the flexpage hierarchy.
  • %FPNEXTBUTTON%: Prints the next button if the flexpage is configured to display it and has a flexpage before the current flexpage in the flexpage hierarchy.
  • %FPTABS%: Displays only the flexpage menu that is set to be the top tab.

Messaging variables

  • %ALERTBADGE%: Displays the alert badge messages icon and a expandable window with the alerts in it.

Site variables

  • %SITEFULLNAME%: Renders the full name of the site.
  • %SITESHORTNAME%: Renders the short name of the site.
  • %SITESUMMARY%: Renders the summary of the site.

User variables

  • %ADDRESS%: Renders the user’s address as it appears in the user’s profile.
  • %CITY%: Renders the user’s city as it appears in the user’s profile.
  • %COUNTRY%: Renders the user’s country as it appears in the user’s profile.
  • %DEPARTMENT%: Renders the user’s department as it appears in the user’s profile.
  • %EMAIL%: Renders the user’s e-mail address as it appears in the user’s profile.
  • %FIRSTNAME%: Renders the user’s first name as it appears in the user’s profile.
  • %IDNUMBER%: Renders the user’s ID number as it appears in the user’s profile.
  • %INSTITUTION%: Renders the user’s institution as it appears in the user’s profile.
  • %LASTNAME%: Renders the user’s last name as it appears in the user’s profile.
  • %MYCOURSES%: Renders a list of <li> HTML tags for each course that the user is enrolled in. An Express design should wrap an ordered list or unordered list HTML tag around this variable. This is most often used in a JavaScript drop-down list in the header of the design.
    Example: <ul id=”mycourses”>%MYCOURSES%</ul> Allow My Courses must be set to “Yes” in the Express site settings for this variable to work.

    This feature could cause performance issues a large number of courses.

  • %MYCOURSESYUI%: Renders a YUI-appropriate menu item that contains each course that the user is enrolled in. This is best used in the Express menu but can be used by itself if a developer understands how the YUI menu works. Allow My Courses must be set to “Yes” in the Express site settings for this variable to work.
  • %PHONE1%: Renders the user’s phone number as it appears in the user’s profile.
  • %PHONE2%: Renders the user’s mobile phone number as it appears in the user’s profile.
  • %PICBIG%: Renders the image tag to display the user’s large formatted profile picture. It also adds a custom CSS class called “userpicbig” to allow a developer to customize the height and width of the image through CSS.
  • %PICSML%: Renders the image tag to display the user’s small formatted profile picture. It also adds a custom CSS class called “userpicsml” to allow a developer to customize the height and width of the image through CSS.
  • %PICBIGURL%: Renders the URL to display the user’s large formatted profile picture.
  • %PICSMLURL%: Renders the URL to display the user’s small formatted profile picture.
  • %SESSIONKEY%: The user's current session key, to be used with links that require the session key in the URL.
  • %USERID%: Renders the user's ID number. This should be used to create dynamic links to the user profile or blocks and activities that use the user's ID.
  • %USERNAME%: Renders the user's user name. This can be used to create dynamic links, or to display to the user they are logged in as a specific user name.

Custom profile field variables

Custom profile field variables are named based on the short name assigned when the custom profile field was created. Text-area type custom profile fields cannot be displayed in a design.

Variable names should be all uppercase with a percentage (%) symbol at the beginning and end. You will need to enable custom profile fields in the Express settings (through the Site Administration block) to use custom profile field variables.

This feature could cause performance issues with a large number of custom profile fields.

Example:

  • Custom profile field short name: major
  • Express Designer variable: %MAJOR%

URL variables

  • %DESIGNDIR%: Renders the beginning of the URL to access a file in the Express storage directory. This is usually used in img tags and CSS to load images that are stored in the design directory. This replaces the mPower variable %SITETHEMEDIR%.
  • %WWWROOT%: Renders the Web root directory for the site.

Express If variables

Express If variables provide Express with a very limited version of programming. Express searches a layout file for these variables. When it finds a variable, it makes a determination to display or not display the HTML code between the opening if variable and the closing if variable.

Example use of If variables

IFNOTLOGGEDIN

<form action="%WWWROOT%/login/index.php" method="post" class="guestinfo">
Username: <input type="text" name="username" value="Username">
Password: <input type="password" name="password" value="Password">
<input type="submit" class="loginbutton" value="Login">
</form>

IFNOTLOGGEDIN

Express will not display the HTML code between the IFNOTLOGGEDIN variables if the user has logged in, but it will display the HTML if the user is accessing the page as a guest.

Options

  • IFHASFOOTER: If the option nofooter is set to true then the HTML within these variables will not be printed.
  • IFSHOWCOURSEHEADERFOOTER: IF the option nocourseheaderfooter is set to true the HTML within this area will display. This is used with the %COURSEHEADER%, %COURSECONTENTFOOTER%,%COURSECONTENTHEADER% and %COURSEFOOTER% variables.
  • IFSHOWLOGININFO: If the notlogininfo option is set to true then the HTML with in will not be displayed.

Course

  • IFINCOURSE: This will display the HTML within if the user is on a page within a course.
  • IFSHOWCOURSEFOOTER: If the course footer has content then the HTML within is displayed.

Site

  • IFATSITE: This will display the HTML within if the user is on a page that is within the site course.

Flexpage

The Flexpage if variables display HTML based on flexpage settings and flexpage block regions.

  • IFHASNEXTORPREVIOUS: If the flexpage is set to display the next or previous buttons then the HTML within these variables will display.

    Example use of IFHASBEXTPREVIOUS

    IFHASNEXTORPREVIOUS

    <div class="flexpage_prev_next">
    %FPPREVIOUSBUTTON%
    %FPNEXTBUTTON%
    </div>

    IFHASNEXTORPREVIOUS

  • IFHASMAIN: If the block region main has blocks in it or if the user is moving blocks the HTML within these variables will display. Usually this will contain the Express Design Variable %MAIN% to display the blocks associated with that region. This region is generally only used in Flexpage.
  • IFHASSIDETOP: If the block region side-top has blocks in it or if the user is moving blocks the HTML within these variables will display. Usually this will contain the Express Design Variable %SIDETOP% to display the blocks associated with that region. This region is generally only used in Flexpage.

Block Regions

Block region if variables will not display the HTML within if any of the following is true:

  1. The block region is not in the regions tag in the manifest.xml file for the current layout file being viewed.
  2. The noblocks option is set to true in the manifest.xml file for the current layout file being viewed.
  3. No blocks are currently in the block region and the user is not moving a block.
  4. IFHASBLOCKREGION1: If the custom region blockregion1 has blocks in it or if the user is moving blocks the HTML within these variables will display. Usually this will contain the Express Design Variable %BLOCKREGION1% to display the blocks associated with that region.
  5. IFHASBLOCKREGION2:If the custom region blockregion2 has blocks in it or if the user is moving blocks the HTML within these variables will display. Usually this will contain the Express Design Variable %BLOCKREGION2% to display the blocks associated with that region.
  6. IFHASBLOCKREGION3:If the custom region blockregion3 has blocks in it or if the user is moving blocks the HTML within these variables will display. Usually this will contain the Express Design Variable %BLOCKREGION3% to display the blocks associated with that region.
  7. IFHASBLOCKREGION4:If the custom region blockregion4 has blocks in it or if the user is moving blocks the HTML within these variables will display. Usually this will contain the Express Design Variable %BLOCKREGION4% to display the blocks associated with that region.
  8. IFHASSIDEPOST: If the block region side-post has blocks in it or if the user is moving blocks the HTML within these variables will display. Usually this will contain the Express Design Variable %SIDEPOST% to display the blocks associated with that region. This is always the right hand side of a Joule page. Usually this will contain the following html:

    <div id="region-post" class="block-region">
    <div class="region-content">
    %SIDEPOST%
    </div>
    </div>

  9. IFHASSIDEPRE: If the block region side-pre has blocks in it or if the user is moving blocks the HTML within these variables will display. This is always the left hand side of a Joule Page. Usually this will contain the following html:

    <div id="region-pre" class="block-region">
    <div class="region-content">
    %SIDEPRE%
    </div>
    </div>

User

The user if variables display HTML content between the variables based on the user's state.

  • IFSITEADMIN: This will display the HTML within if the user has been assigned as a site administrator.
  • IFLOGGEDIN: This will display the HTML within these variables if the user has logged in.
  • IFNOTLOGGEDIN: This will display the HTML within these variables if the user is not logged in and is considered a guest.