Adding a parameter in the template to override the default stylesheet path

When working with templates, you might have the same layout for various documents, but a different set of styles.

In this case, the easiest way to adjust your template to obtain the desired output is to use a different stylesheets for each of your output types and a parameter which would set your stylesheet's path.

Below you will find instructions on how to set a parameter to override the defaut stylesheet path and setting the parameter to reference dynamically the stylesheet's path.

Defining the parameter:
- Access the File -> Options -> Developer section and check the "Show Developer tab" option
- Access the "Developer" tab
- Select the "Manage Parameters" button
- From the "Parameters" pane, select the "Add new parameter" button
- In the opened "Insert parameter" dialog, add the parameter's name (ex: "StylesheetParameter")

Set the parameter to reference the dynamic stylesheet's path:
- Access the "Home" tab
- From the "Style" area, select the "Manage Styles" button, and then select the "Manage Styles" option
- From the "Styles" pane, select the "More Options" (dots ...) button and choose the "Dynamic Stylesheet" property
- For the Default Value, select the "fx" button
- From the "Create Expression" dialog, select the "Add parameter" button and choose the parameter previously created (in this case, "StylesheetParameter")

Setting the parameter programmatically:

Once you finish adding a parameter in the template, you can change the stylesheet programmatically by adding the following code:

xsl_param.Add("StylesheetParameter", @"....\TheCss.css");

Have more questions? Submit a request

Comments

Powered by Zendesk