The following warnings occurred:
Warning [2] Undefined array key "threadviews_countguests" - Line: 745 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php 745 errorHandler->error_callback
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 830 postParser->parse_message
/showthread.php 916 build_postbit
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 861 postParser->parse_message
/showthread.php 916 build_postbit
Warning [2] Undefined property: MyLanguage::$thread_modes - Line: 46 - File: showthread.php(1650) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php(1650) : eval()'d code 46 errorHandler->error_callback
/showthread.php 1650 eval




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom Styles not Displayed in Editor
#4
I'm using the following setup, which shows the styles in the styles dropdown as well as showing the site's styles in the WYSIWYG area.

gsconfig.php:
Code:
define('GSEDITOROPTIONS',
  " toolbar: [
            ['Bold', 'Italic', 'Underline', 'NumberedList', 'BulletedList', 'JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock', 'Outdent', 'Indent'],
      ['Table', 'Link', 'Unlink', 'Image', 'RemoveFormat', 'Source'],
      '/',
      ['Styles','Format'],
    ],
    stylesCombo_stylesSet: 'my_styles:/theme/Choice/styles.js',
    contentsCss: '/theme/Choice/default.css',
    bodyId: 'content'
");
(as Connie has already pointed out to me, I could have defined the toolbar within GSEDITORTOOL)

theme/Choice/styles.js:
Code:
CKEDITOR.addStylesSet( 'my_styles',
[
    // Block Styles
    { name : 'Normal', element : 'p', attributes : { } },
    { name : 'Motto1', element : 'p', attributes : { 'class' : 'motto1' } },
    { name : 'Motto2', element : 'p', attributes : { 'class' : 'motto2' } },
    { name : 'Motto3', element : 'p', attributes : { 'class' : 'motto3' } },
    { name : 'Rechts', element : 'p', attributes : { 'class' : 'rfloat' } },
    { name : 'Links', element : 'p', attributes : { 'class' : 'lfloat' } },

    // Inline Styles
    { name : 'Code', element : 'span', attributes : { 'class' : 'code' } },
]);

theme/Choice/template.php (important: use same ID for content div as for bodyId in CKEDITOR settings):
Code:
...
  <div id="content" class="<?php echo return_page_slug(); ?>">
    <h1 id="pagetitle"><?php echo stripslashes($title); ?></h1>
    <?php get_page_content(); ?>
  </div>
...

theme/Choice/default.css (important: use body#content for editor specific styles, like reset padding, margin, etc.; specify the styles for the style dropdown without #content)
Code:
body#content { /* for the editor */
  width: 94%;
  ...
}
#content p { /* for site and editor */
  ...
}
...
.motto1 { /* without #content */
  ...
}

Finally press F5 multiple times in your browser, clear the cache, etc. until the editor looks the same as the site ;-)
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply


Messages In This Thread
Custom Styles not Displayed in Editor - by Alan-A - 2011-09-18, 20:07:14
Custom Styles not Displayed in Editor - by Alan-A - 2011-09-18, 20:40:53
Custom Styles not Displayed in Editor - by Connie - 2011-09-18, 20:42:11
Custom Styles not Displayed in Editor - by mvlcek - 2011-09-18, 21:05:34
Custom Styles not Displayed in Editor - by Alan-A - 2011-09-19, 02:36:02
Custom Styles not Displayed in Editor - by Alan-A - 2011-09-28, 03:11:44
Custom Styles not Displayed in Editor - by Connie - 2011-09-28, 03:25:23
Custom Styles not Displayed in Editor - by Alan-A - 2011-09-28, 18:10:46
Custom Styles not Displayed in Editor - by Alan-A - 2011-09-30, 00:23:42
Custom Styles not Displayed in Editor - by mvlcek - 2011-09-30, 00:58:45
Custom Styles not Displayed in Editor - by Alan-A - 2011-09-30, 03:02:06
Custom Styles not Displayed in Editor - by mvlcek - 2011-09-30, 03:30:48
Custom Styles not Displayed in Editor - by Connie - 2011-09-30, 03:30:55
Custom Styles not Displayed in Editor - by Alan-A - 2011-10-03, 01:11:50
Custom Styles not Displayed in Editor - by mvlcek - 2011-10-03, 01:36:08
Custom Styles not Displayed in Editor - by Alan-A - 2011-10-03, 02:10:16



Users browsing this thread: 2 Guest(s)