FCKeditor template DIY

Source: Internet
Author: User

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
  1. <?XML Version= "1.0"Encoding= "UTF-8"?>
  2. <Templates Imagesbasepath="Fck_template/images /">
  3. <! -- Above node: the starting root node of the template function and used to specify the directory location of the template -->
  4. <! -- For example, the preceding Address indicates that my current template image file is in the \ test project \ FCKeditor \ editor \ dialog \ fck_template \ images -->
  5. <Template Title="FCKeditor self-built template" Image="Template4.jpg">
  6. <! -- 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. -->
  7. <! -- Above node: the other two attributes indicate the template prompt name and the example graph file name -->
  8. <Description>This template is the subject of the Acceptance Report.</Description>
  9. <! -- Above node: Function Description of the template -->
  10. <! -- The following node: The table label is the template body, which can be operated freely according to the user -->
  11. <Html>
  12. <! [CDATA [ 
  13. <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>
  14. ]>
  15. </Html>
  16. </Template>
  17. </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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.