[XE]에디터에서 글 작성시 서식 사용하기


XE기본기능으로 들어가 있는데 잘 사용하지 않는 기능인것 같다. 회사 홈피를 작성하면서 일정한 양식으로 페이지를 작성해야하는 문제를 격으면서 사용 팁을 여기에 정리해 본다. 
서식기능은 관리자가 임의로 설정해둔 내용이 글 작성 버튼을 누르면 내용 입력폼에 자동으로 기본 서식이 출력되는 기능입니다. 그러므로 필요한 양식(이하 서식)은 직접 만드셔야 됩니다.
우선 기능을 익히기 위해 직접 만들어 보면 감이 잡힐 겁니다.

  1. /modules/editor/styles 폴더에 새로운 폴더를 만듭니다. (product_style 폴더)
  2.  default 스타일 화일을 그대로 복사 해서 옮겨 왔습니다. (자신의 능력하에 직접 파일을 만드셔도 됩니다.) - 아래 파일을 전부 복사해서  newstyle 폴더에 붙여넣기!!
  3. editor.html 파일을 열어  <body> </body> 태그 사이에 내용을 작성해 줍니다.
     - HTML 도 사용가능하며 이곳에 작성 된 내용이 기본 서식으로 출력 됩니다.
     - 이때 html 파일의 저장은 꼭 UTF-8로 해주세요 안그러면 한글이 깨져서 나옵니다
  4. 문제점 수정 - 이렇게 서식을 정의하고 나면 댓글 서식도 변경됩니다. 댓글 서식은 기본 서식을 그대로 사용하는 것이 편리하므로 다음과 같이 처리해 주면 됩니다.

     /modules/editor/editor.model.php
    line 242  주석 처리

     function getModuleEditor($type = 'document', $module_srl, $upload_target_srl, $primary_key_name, $content_key_name) {
                // 지정된 모듈의 에디터 설정을 구해옴
                $editor_config = $this->getEditorConfig($module_srl);
                // type에 따른 설정 정리
                if($type == 'document') {
                    $config->editor_skin = $editor_config->editor_skin;
                    $config->content_style = $editor_config->content_style;
                    $config->content_font = $editor_config->content_font;
                    $config->content_font_size = $editor_config->content_font_size;
                    $config->sel_editor_colorset = $editor_config->sel_editor_colorset;
                    $config->upload_file_grant = $editor_config->upload_file_grant;
                    $config->enable_default_component_grant = $editor_config->enable_default_component_grant;
                    $config->enable_component_grant = $editor_config->enable_component_grant;
                    $config->enable_html_grant = $editor_config->enable_html_grant;
                    $config->editor_height = $editor_config->editor_height;
                    $config->enable_autosave = $editor_config->enable_autosave;
                } else {
                    $config->editor_skin = $editor_config->comment_editor_skin;
                    //$config->content_style = $editor_config->content_style;                $config->content_font = $editor_config->content_font;
                    $config->content_font_size = $editor_config->content_font_size;
                    $config->sel_editor_colorset = $editor_config->sel_comment_editor_colorset;
                    $config->upload_file_grant = $editor_config->comment_upload_file_grant;
                    $config->enable_default_component_grant = $editor_config->enable_comment_default_component_grant;
                    $config->enable_component_grant = $editor_config->enable_comment_component_grant;
                    $config->enable_html_grant = $editor_config->enable_comment_html_grant;
                    $config->editor_height = $editor_config->comment_editor_height;
                    $config->enable_autosave = 'N';
                }

    빨간색으로 된 부분을 주석 처리 하시면 댓글에 서식이 적용되지 않습니다. 


    /*========== 중요========= */

    XpressEditor 사용상 약간 불편한 점으로(다른 에디터는 잘 모르겠네요) 테이블 문제가 있습니다.
    테이블 생성시 테이블의 상하에 여백이 없으면 커서가 테이블 밖으로 나갈 수 있는 방법이 없습니다.
    html 을 아는 분들은 별도로 html 수정을 통해 공간을 만들지만 일반적으로 위지윅 에디터를 사용하는 유저들은 짜증을 부리게 되더군요.
    사내에서 XE를 사용중인데 사내 데이터들을 엑셀에서 복사해서 붙여넣는다던가 테이블로 작성하는 경우가 많아서 불평/불만을 많이 듣고 있습니다.
    테이블 생성 시 테이블의 상/하에 <p> 태그 하나 정도 넣어서 커서가 위치할 수 있도록 해주셔야 됩니다.

0 개의 댓글: