Opus   Opus 2.30 Publisher's Manual
   Product Overview
   Installation and Set Up
   Customising a Paper 
   Templates
    Template Merge Fields
    Valid <opustest> names
   Using Datacards
   Using Objects
   Author Maintenance
   Activity Logging
   Technical Issues
   Appendices

Note that text shown in this style documents a feature which isn't in the current release but will be in the next release and text shown thus indicates a feature which is being removed in the next release.

If you find anything in this documentation which is wrong or unclear then please use the link at the bottom on the page to comment and we will update the page to correct it or make it clearer.

Search:


Valid <opustest> names

These are the valid values of "name" in an <opustest> tag in an Opus template:

name= Usage
printable You can produce a "printable" version of an article, typically without the navigation, by clicking on a link. In the printable version condition is set to "Y", otherwise it's set to "N". So if part of the template is wrapped in:

  <opustest name="printable" condition="N">

  </opustest>

  it will only be displayed if the user is viewing the non-printable version of the article.

isprintable If the article is printable (it's not always), then this is set to "Y", otherwise it's set to "N".
browser This lets you specify bits of the template which are only used with certain browsers, and only with certain releases of certain browsers.

The simplest case test for the browser, regardless of version. Possible values for the browser are:

  • "CH" - Chrome
  • "KQ" - Konqueror
  • "NN" - Netscape
  • "MZ" - Mozilla (Gecko core)
  • "OP" - Opera
  • "UN" - unknown (i.e. anything else, including a lot of 'bots)

So:

    <opustest name="browser" condition="IE">

  indicates that the bit of the template which follows should only be used if the browser is Internet Explorer.

You can invert this condition by preceding it with a "!" hence:

    <opustest name="browser" condition="!IE">

  indicates that the bit of the template which follows should only be used if the browser isn't Internet Explorer.

If you need to go a stage further and specify the release of the browser you can specify a release number and one of "gt", "ge" , "eq", "le", or "lt" for greater than, greater than or equal to, equal to, less than or equal to, or less than, and use the "!" prefix to invert the condition. Hence:

    <opustest name="browser" condition="!IEgt5">

  indicates that the bit of the template which follows should only be used if the browser isn't Internet Explorer of release 6 or higher. Note that this is not the same as:

    <opustest name="browser" condition="IElt6">

  which indicates that the bit of the template which follows should only be used if the browser is Internet Explorer but of release 5 or lower.

You can even go down to the decimal part of the release number, in which case the comparison becomes release specific (ie NNgt4 indicates any release of Netscape greater than 4.999, whereas NNgt4.6 indicates Netscape releases greater than 4.6.

articlecode
sectioncode
papercode
typecode
datacard
This lets you specify bits of the template which are only used for certain articles or sections by testing the articlecode, sectioncode or papercode, typecode or datacard name if it's a datacard (so typecode of "xdb") of the article. For example:

    <opustest name="sectioncode" condition="eq5">

  indicates that the template from here on should only be shown for articles in section 5. As with browser releases "gt", "ge", "eq", "le", or "lt" for greater than, greater than or equal to, equal to, less than or equal to, or less than,, and use the "!" prefix to invert the condition are allowed.

An additional test "in" lets you test for a range of values, separated by "|". So for example:

    <opustest name="sectioncode" condition="in5|8|999999">

  indicates that the template from here on should only be shown for articles in section 5, 8 or 999999.

The ability to test on sectioncode is particularly useful as it means one template can be used for several sections while being rendered slightly differently each time.

Comment on this page

Copyright
Privacy Policy