Search code examples
templatesheaderckeditorfooter

how to put header and footer in ckeditor


Is it possible to have header and footer with defined template inside ckeditor? For example, i want to have my 'module-name', 'sub-module' in the header. I've been looking for it but have not found any help. Thanks in advance


Solution

  • Finally, I can see the sun shine.

    I create my header template in stored procedure as my default header template with variable like {company_variable}. Then, on insert trigger I replace it with my value from table. eg; @company_name = company_name

    Using search replace syntax in trigger to replace and update the {company_variable} as depicted below :

    UPDATE [table_name] SET [column_name] = REPLACE([column_name], '{company_variable}', @company_name) WHERE [column_name] like '%{company_variable}%';
    

    The Query above will search for the {company_variable} in the [column_name] column as a tag to be replaced then replace it with the @company_name.

    Example: I want to have a simple header like "TIGOT.CO, Quality is Everything". So, create_header_sp result a set of HTML header template. "<div><strong>{company_variable},Quality is Everything</strong></div>". Finally, using the code in trigger to replace the {company_variable} with the company_name