Configure the preview text setting to customize the default preview text for a
standard article template.
Avant de commencer
Role required: admin
Procédure
-
Navigate to .
-
On the Script Includes page, in the Name field, enter
ArticleTemplateUtilSNC.
-
Open the ArticleTemplateUtilSNC record.
-
On the ArticleTemplateUtilSNC page, copy the following code from the Script field.
setPreviewTextForStandardArticle: function(){
return null;
},
-
On the Script Includes page, in the Name field, enter
ArticleTemplateUtil.
-
Open the ArticleTemplateUtil record.
-
On the ArticleTemplateUtil page, modify the code in the Script field by pasting the copied code as shown.
var ArticleTemplateUtil = Class.create();
ArticleTemplateUtil.prototype = Object.extendsObject(ArticleTemplateUtilSNC,{
type: 'ArticleTemplateUtil',
setPreviewTextForStandardArticle: function(){
return null;
},
});
-
In the Script field, remove
null and
enter a preview text.
-
Select Update.
Résultats
The modified preview text displayed on the standard article template selector.
Exemple
The following code is modified to show custom preview text. You can also include HTML tags to modify the appearance of preview text.var ArticleTemplateUtil = Class.create();
ArticleTemplateUtil.prototype = Object.extendsObject(ArticleTemplateUtilSNC,{
type: 'ArticleTemplateUtil',
setPreviewTextForStandardArticle: function(){
return 'Demo for standard article';
},
});