Scripting in Corporate Publisher – Basic Knowledge

Corporate Publisher allows you add automatically  ”variable information” to output the content of Corporate Exchange (underlying database).

The purpose of this functionality is to automatically add some text to the output HTML when the HTML pages are published. Corporate Publisher users add a “variable” to their textual content which is then replaced in the HTML with the value it represents at the time of publication.

This functionality helps the Corporate Publisher user in a number of ways, allowing them to add one piece of text to multiple documents, control where that text is output, replace that text with “current values” in the model, and choose whether or not to represent that text based on conditions.

Where to add CP Scripting?

Please Login or Register to see the link.

Corporate Publisher Editor

Corporate Publisher will ‘parse’ embedded HTML output for defined scripting ommands. ‘Embedded HTML output’ is considered any of the following:
  • Contents of the ‘Global HTML’ Publication Set Property
  • Contents of the ‘HTML Header’ Publication Set Property
  • Contents of the ‘HTML Footer’ Publication Set Property
  • Contents of multi-line text properties of any published object.

What is the Format of CP Scripting Commands?

As part of Global HTML, HTML Header or HTML Footer

The command is written as a HTML comment using the following format:

<!– #CP_START# {HTML} #CP_END# –>

Where:

<!– Start of HTML Comment Tag

#CP_START# Required Tag denoting beginning of HTML code block to be checked for CP Scripting commands

{HTML} The HTML code block to be checked and then written

#CP_END# Required Tag denoting end of HTML code block to be checked

–> End of HTML Comment Tag

As part of multi-line text property

Important differences:

1. As each line of a multi line text field is parsed separately the entire <!– #CP_START# {i}{HTML}{i} #CP_END# –> meta command must be specified on one line.

2. As the meta-command itself and the {HTML} section is HTML code you must enclose the meta-command within [HTML On] and [HTML Off] blocks otherwise the command will be convereted to displayable text before it can be actioned.

Please Login or Register to read the rest of this content.

Other posts of the serie

  1. Create a HTML Publication with tabs -
  2. Scripting in Corporate Publisher - Basic Knowledge (This post) -
  3. Corporate Publisher Scripting - Example -
  4. Corporate Publisher and Google Technology -
  5. Corporate Publisher Scripting - The Conclusion -

Leave a Reply