Backend Operations
When Alternate Contexts are configured on the Contexts Configuration screen, additional fields become available within Squiz Matrix, allowing you to further configure and edit the contexts in the system.
Bookmarks to the headings on this page:
Editing and Reviewing Contexts within the System
The Change Context Field
When Alternate Contexts have been created, the Change Context field will appear in the info bar of all assets, as shown in the figure below.

The Change Context field in the info bar
This field allows you to select either the Default Context or any available Alternate Contexts when editing or reviewing an asset. By selecting Alternate Contexts, you can establish alternate versions of an asset by creating unique context specific content. By default, all assets will be displayed in the Default Context.
To select a context using the Change Context list, click the Change button. A list of available contexts will become available, as shown in the figure below.

The contexts drop down list
Selecting a context from this list will load the current asset screen in the selected context. If you have selected an Alternate Context that has not yet been edited, the information and content displayed will be the same as that on the Default Context. Any changes made to an Alternate Context will remain unique to that specific context, as shown in the figure below.

Content on the Default and Alternate Contexts
Returning Keyword Replacement Values Across Contexts
Keyword replacement values can be returned across the contexts of a Site through the following format:
%<asset_keyword>^context:<context_name>%
where <asset_keyword> is a contextable keyword replacement and <context_name> is the name of the context to return the asset value from. For example, the keyword replacement:
%asset_attribute_name^context:French%
will return the name of the asset in the French context.
Setting Metadata Field Values and Defaults Over Multiple Contexts
When using Alternate Contexts within a system, metadata values can be configured individually over multiple contexts and default values can be set for each of these contexts.
Metadata must be manually regenerated on each newly created context before it will be applied.

Metadata over multiple contexts
Setting metadata values and defaults over multiple contexts is done in a similar fashion to editing the contents of an asset, as shown earlier in this chapter. Using the Change Context drop down list, select a context that you want to edit the metadata for. If you have selected an Alternate Context that has not yet had metadata values and defaults edited, the information displayed will be the same as that on the Default Context. Any changes made to the Metadata Field values and their defaults will remain unique to the selected context, as shown in the figures below and to the right.
Please note that the Field Name and metadata Options on the Details screen of a Metadata Field are not contextable.

The Metadata Field default values over multiple contexts

The Contextable? option
Alternatively, Metadata Fields can be configured to be non-contextable. This is done using the Contextable? option on the Details screen of a Metadata Field, as shown in the figure to the right.
Setting this field to No will maintain metadata values across all contexts. This is useful when setting important numeric metadata values for information such as product quantities and pricing in an ecommerce store.
By default, all Metadata Fields are contextable.
Using Paint Layouts on Sites with Multiple Contexts
When using Paint Layouts on a multiple context Site, these layouts are rendered by the currently viewed context, displaying the Paint Layout’s corresponding context. This allows you to customise the contents of the layout for each context.
In the example below, a Site has been created with three contexts: the Default English Context, a French Context and a Japanese Context. A Paint Layout has been used on the Site to display update information at the bottom of each page, titled Last Updated. As the Site is in multiple languages, the Paint Layout must be configured for each context to display this information in the appropriate language, as shown in the figure below.

Paint Layout content for the English (top), French (middle) and Japanese (bottom) contexts
When a user views the Site on the Frontend, the Paint Layout displayed will be determined by the context of the Site they are viewing. For example, if a user from France views the French Context of the Site, the French Context of the Paint Layout will also be displayed. This is shown in the figures below.

French context Paint Layout

English context Paint Layout

Japanese context Paint Layout
Contexts on the Preview Screen
When previewing an asset on the Preview screen, the Context field gives you the ability to switch between the contexts available for the asset. This allows you to preview all versions of an asset. Please note that if Alternate Contexts have not been created in your system, the Context field will appear blank, as shown in the figure below.

The Preview Options section on a system without Alternate Contexts
When no Context field is available, the system’s Default Context will always be displayed. On a system where Alternate Contexts have been created, a drop down list will be displayed, as shown in the figure below.

The Context drop down list on the Preview screen
The following options are available in the Context field:
- Use normal context for this URL: this will display the asset in the Base Context of the URL being previewed. By default, this will be the system’s Default Context. For more information, refer to the Setting Base Contexts for Site URLs section in this chapter.
- Default Context: this will display the asset in the system’s Default Context.
- Alternate Context(s) : the available Alternate Contexts in the system will be listed below the Default Context, as shown in the figure below.
Selecting an Alternate Context will preview the asset in that specific context.
The Alternate Context preview options
Tip: To review a context on the Frontend, append the query string parameter SQ_ACTION=set_context&SQ_CONTEXT_NAME=name of context to the URL of the asset. You can also clear the context of a page with SQ_ACTION=clear_context.
Setting Base Contexts for Site URLs
When Alternate Contexts have been created, the Base Context field is made available on the URLs screen of Site assets, allowing contexts to be assigned to specific Site URLs. These Base Contexts will then be used as the default context for that URL and will be displayed if no Alternate Contexts’ conditions are met. The Base Contexts field on the URLs screen is shown in the figure below. By default, the Base Context of all URLs will be the system’s Default Context.

The Base Context field on the URLs screen
To change the Base Context of a URL, select a context from the list and click the Commit button. This context will then be used as the default context for the Site.
Separate URLs for Multiple Contexts
Base Contexts can be utilised by creating multiple URLs, catering to specific Alternate Contexts. For example, in the figure below, a Site has been configured with three different URLs for each of its language Alternate Contexts. Please note that no conditions have been set for these contexts.

Separate URLs for multiple contexts
When the Site is viewed on the Frontend, each URL will display the selected Base Context. The configured URLs can then be used as links, allowing users to manually change the context of the Site, as shown in the figure below.

The Contexts of a single asset on multiple URLs
Tip: You may need to edit the parse file of your design to display asset-level contextual information. In the example above, the asset_attribute_name keyword has been used in the asset_lineage and menu_normal design areas to display the correct page name information for each context. For more information on these design areas, refer to the Designs Manual.
Setting the Login Context for User Groups
When you have multiple contexts on a system, it can be useful to configure certain User Groups to be automatically assigned to a specific context when they first log in to Squiz Matrix. For example, say you have a multi-language site with both English and French versions and two corresponding User Groups of content editors for each language. You can configure these two User Groups so that the English Content Editors will be logged into the English context of the system, while the French Content Editors will be logged into the French context of the system, as shown in the figure below.

The Set context on login preference on the Backend
To do this, go to the Preferences screen of the User Group. Under the User Preferences section, select Customise this preference for the Set context on login preference and click Commit. An additional field will appear in this section, listing the available contexts on your system in a drop-down menu, as shown in the figure above. Select the context you want this User Group to be automatically logged into and click Commit. The users within this User Group will now be logged into the selected context when they first access the system. Selecting Do not change context on login will log users in using the context assigned to the URL used to access the system.
This preference also assigns contexts to User Groups when viewing Sites on the Frontend. For example, in this Site we also have two User Groups of registered users, English Users and French Users. Configuring this preference for these two User Groups will mean that the English Users will be logged into the English version of the Site, while the French Users will be logged into the French version of the Site, as shown in the figure on the below.

The Set context on login preference on the Frontend
These preferences can be set globally via the Global Preferences screen. For more information on user preferences, refer to the Global Preferences chapter in the System Configuration manual.