Setting the Outline to be auto-expanded when the Player is opened

From UPK wiki
Jump to: navigation, search

Contents

Overview

By default, when a user opens the Player, only the highest-level Outline Elements are visible, and the user needs to open these (and drill down) to display the content. If you only have a relatively small number of elements in your Outine, you may find it worthwhile (and easier for your users) if all levels of the hierarchy are automatically opened when the Player is launched.

Procedure

UPK 11

To set the Outline to automatically expand when it is first displayed, carry out the following steps:

  1. Check out and open the Payer Publishing Package
  2. Within the Publishing Package, open the file tree.js using Notepad or other editor
  3. Locate the function IsAutoExpand. This will look like:
function IsAutoExpand()	// true if the tree must be appear expanded
{
   if (treeViewMode == "ALL")
       return false;
   else if (treeViewMode == "FILTERED")
       return (modeDescF.filteredTopicCount < TreeConfig.AutoExpandLimit)
   else if (treeViewMode == "FILTEREDHEMI")
       return (modeDescF.filteredTopicCount < TreeConfig.AutoExpandLimit)
   else	//"HEMI"
       return (modeDescH.filteredTopicCount < TreeConfig.AutoExpandLimit)
}
  1. Change this to:
function IsAutoExpand()	// true if the tree must be appear expanded
{
   if (treeViewMode == "ALL")
       return true;
   else if (treeViewMode == "FILTERED")
       return (modeDescF.filteredTopicCount < TreeConfig.AutoExpandLimit)
   else if (treeViewMode == "FILTEREDHEMI")
       return (modeDescF.filteredTopicCount < TreeConfig.AutoExpandLimit)
   else	//"HEMI"
       return (modeDescH.filteredTopicCount < TreeConfig.AutoExpandLimit)
}
  1. Save tree.js
  2. Save and exit the Publication Package, and check it in.

Note:
If you want to make this change for only a single Player (as opposed to all published Players, make the same change as above to the tree.js file contained in the PlayerPackage/js folder.

UPK 12

UPK 12 made it much easier (kind of) to perform this customization.

  1. Open the Player Publishing Format Package.
  2. Locate the file config.xml within this package
  3. Locate the following line within this file:
  <item name="DefaultExpandLevel">1</item>
  1. Change the number to however many levels of the Outline you want to display by default. If you want to expand all levels then set this to 99 or some number higher than the maximum number of levels in your Outline. Note that the higher this number, the longer the Outline will take to build.
  2. Save the config.xnl file
  3. Save your Publishing Format Package and check it in

Note:
If you want to make this change for a single, published Player, Locate the config.js file in the PlayerPackage folder folder, and change the DefaultExpandLevel: 1 line.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox