Description
Merges the structure of the source (template) article on the current article, by adding to the current article the elements that exist in the source (template) article, and also optionally removing from the current article the elements that exist only in the current article.
To merge the content of the article, see MergeFromArticleEx and MergeFromArticle.
Syntax
object.ApplyArticleTemplate (TemplateId, Mode) |
object
Required. Object name. Returned by Ted.GetActiveArticle.
TemplateId
the Id of the template article (can be get for example using Ted.ArticleSelectDlg)
Mode
0: all elements present in the current articles and not in the template are removed
1: all elements present in the current articles and not in the template are leaved
2: a message is shown to confirm element removal
Remarks
After execution, the current article will have its original elements, plus added new elements that exist in the template article. The merge adds the images and multiple occurrences of the elements, e.g. multiple pull quotes etc. If you repeat the merge, the already merged elements will not be added again.
Local geometries are also copied.
Example
This script applies the structure of the article with ID=25 to the current article, keeping the original elements of the current article.
If Ted.HasActiveArticle Then dim objarticle=ted.getactivearticle dim templateid = 25 objarticle.ApplyArticleTemplate (TemplateId, 1) End If |
Context
Article object