Today, I spent some time studying the template of the FCKeditor editor. In fact, it is very simple. You only need to modify a file to implement DIY.
FCKeditor/fcktemplates. xml Code Structure Analysis
-
- <?XML Version= "1.0"Encoding= "UTF-8"?>
-
- <Templates Imagesbasepath="Fck_template/images /">
-
- <! -- Above node: the starting root node of the template function and used to specify the directory location of the template -->
-
- <! -- For example, the preceding Address indicates that my current template image file is in the \ test project \ FCKeditor \ editor \ dialog \ fck_template \ images -->
-
- <Template Title="FCKeditor self-built template" Image="Template4.jpg">
-
- <! -- Above node: indicates different templates one by one. For example, if I create multiple groups of template nodes, multiple templates will be displayed for the editor users to choose from. -->
-
- <! -- Above node: the other two attributes indicate the template prompt name and the example graph file name -->
-
-
- <Description>This template is the subject of the Acceptance Report.</Description>
-
- <! -- Above node: Function Description of the template -->
-
- <! -- The following node: The table label is the template body, which can be operated freely according to the user -->
-
- <Html>
-
- <! [CDATA [
-
- <Table align = "Left" cellspacing = "0" cellpadding = "0" width = "98%" border = "0">
<Tbody>
<Tr>
<TD colspan = "4" align = "center"> </TD>
<TD align = "center"> & nbsp; </TD>
<TD align = "center"> & nbsp; </TD>
</Tr>
</Tbody>
</Table>
-
- ]>
- </Html>
-
- </Template>
-
- </Templates>
<Templates/> nodes are the root nodes of the template function. They cannot be multiple nodes. <template/> nodes represent different nodes. If no more nodes exist, one template is added, in the template body, that is, within the
Netease's mailbox is used or used by many people. There are a large number of templates in it. Check the code and add it. I added only one of the above items. You can also view the comments in the above Code.
PS: This method is more practical than the template plug-in the Z-blog forum. It is not in the form of a plug-in, and FCKeditor is directly moved.
Insert content template "Replace current content" option changes in fckconfig. JS, modify
Fckconfig. templatereplaceall = false; (whether to replace the current content)
Fckconfig. templatereplacecheckbox = true; (whether to display multiple selection boxes that replace the current content)
after modification, remember to update the cache, delete cookies, and offline temporary files (for example, test on the local machine)