Some existing macros have many complex parameters, and you may want to get some standardization over their usage. Script macros provide an easy way to standardize parameters.
For example, the Table of Contents macro has many parameters. Use the following task as an example of re-using existing macro parameters:
In a sample page, configure the Table of Contents macro parameters like you would want your users to.
View the storage format of the page.
Copy the macro XHTML from the storage format, which should look similar to the following image:
Create a new script macro with no body and no parameters.
Add script to the macro, which should look similar to the following code:
You must use the
convertStorageToViewmethod, as shown in the example code, to convert from storage format to HTML.
When you finish this task, the new macro uses the Table of Contents macro parameters.
For an example, view the Include All Child Pages example.