Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2016
    Location
    Dallas, TX USA
    Posts
    71
    Plugin Contributions
    0

    Default CK Editor messy code

    [Note: remember to include site URL, ZC version, list of plugins, PHP version, etc ... read the Posting Tips shown above for information to include in your post here. And, remove this comment before actually posting!]

    I've been using the CK Editor to manage the main page content. I've found that the code it creates is extremely messy and doesn't often appear in the live cart in the same way it appears in the editor. Variations include spacing and size of the text.

    Even if I paste very clean code into the source of the editor, once I post it, it adds a bunch of extra tags & junk.

    Is there a better way to approach this?

  2. #2
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: CK Editor messy code

    Perhaps you could provide some example(s) of the issue? Including the content attempted/desired to be entered and the page(s) associated with that would help. Working from the admin side there are storeside css files that are not brought into the editing which can have an effect on the final outcome, additionally yes by default there are some html tags that are added to account for expected formatting (paragraph tag for example).

    Regarding sizing, it can also depend on how the html tag is formatted as to whether it is one to increase/decrease the size or to call for a specific size.

    As to "space", not sure if you mean the space between say the end of a sentence and the start of the next sentence of the same paragraph/group or say the space between two paragraphs. I haven't seen that the editor adds space characters within a paragraph nor extra lines of content between paragraphs, but the css that gets applied on the store front can cause the content to look like such space has been added. Yes, if two spaces are attempted the second will be changed to the html representation of a space & n b s p; (spaces removed), but that is to force the additional space to be shown. (Html treats multiple spaces as a single space.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,571
    Plugin Contributions
    30

    Default Re: CK Editor messy code

    I find it better to write and format html content in a real wysiwyg editor, not just for seeing how it will look but just so the html tags are created with no extra junk.
    I make a temporary file in the root of the shop so any images I embed in the text can be correctly referenced/inserted and hard-code links in the file head to the css and js used on the product page.
    When done I just copy and paste the source into the admin product edit description.

    Although I use Dreamweaver mainly, I also use Blue Griffon. Sea Monkey (Composer) is another alternative.
    Steve
    github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

 

 

Similar Threads

  1. Plain Text editor munging code in define pages editor
    By TecBrat in forum Customization from the Admin
    Replies: 2
    Last Post: 24 Feb 2013, 12:19 PM
  2. Defines editor saving code wrongly
    By horsetags in forum General Questions
    Replies: 2
    Last Post: 28 Oct 2010, 11:27 PM
  3. html editor showing as code on site
    By Wilfred in forum Basic Configuration
    Replies: 3
    Last Post: 19 Oct 2010, 07:50 PM
  4. HTML editor Saving code wrong on me
    By cshart in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 16 Nov 2007, 10:54 PM
  5. HTML editor Saves code wrong
    By cshart in forum Bug Reports
    Replies: 0
    Last Post: 16 Nov 2007, 07:08 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR