Announcement

Collapse
No announcement yet.

Rich Text Editor Nightmare - Options?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Thanks, That works, but also removes line breaks at the end of the description so all of the products ran rogether.

    But, I wound up downloading Notepad++ and using the instructions from here to remove the line breaks, so I now have a functioning excel file to work with. Progress!!!

    https://stackoverflow.com/questions/...-text/13990281

    Comment


      #17
      Oh, sorry, what I should have added is something like:

      <mvt:assign name="g.thisDescription" value="g.thisDescription $ asciichar(10)$ asciichar(13)"/>

      as the last g.thisDescription.
      Bruce Golub
      Phosphor Media - "Your Success is our Business"

      Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
      phosphormedia.com

      Comment


        #18
        Thank you, for future reference for anyone, that worked. Here is the full code I placed on the PLST page.

        Code:
        <mvt:foreach iterator="product" array="all_products:products">
        
            <mvt:assign name="g.thisDescription" value="glosub(l.settings:product:descrip, asciichar(10), '')" />
            <mvt:assign name="g.thisDescription" value="glosub(g.thisDescription, asciichar(11), '')" />
            <mvt:assign name="g.thisDescription" value="glosub(g.thisDescription, asciichar(12), '')" />
            <mvt:assign name="g.thisDescription" value="glosub(g.thisDescription, asciichar(13), '')" />
        
            <mvt:assign name="g.thisDescription" value="glosub(g.thisDescription, '\r', '')" />
            <mvt:assign name="g.thisDescription" value="glosub(g.thisDescription, '\n', '')" />
        
            <mvt:assign name="g.thisDescription" value="g.thisDescription $ asciichar(10) $ asciichar(13)"/>
        
            &mvte:product:code;|&mvte:product:name;|<mvt:assign name="g.allowed_tags" value="'p,li,ul,b,a,br'" /><mvt:eval expr="miva_html_strip( g.thisDescription, g.allowed_tags )" />
        
        </mvt:foreach>
        Unfortunately, getting the resulting code neatly into Excel was less successful. At some point, thanks to the encoding issues, the content started nesting (it does that on the display of the PLST page as well, although the source code is a nice series of single lines.) In many cases it was only descriptions that combined, but in one case I had 28 products (code, name, description) appended to another product's description. It was not a quick and easy copy and paste to delete the encoding, although I was able to do a certain amount of that. But there were enough variations that it wasn't possible to completely remove the code cleanly. It took me pretty much the entire day to clean up the file and prep it for re-importing, but I am happy to say that it is done, and done successfully!

        Thank you so much to everyone who chimed in. For those who requested a "how-to" I'm reluctant to post one because it really is a hands-on project, but if you can get your data at least mostly cleanly into Excel with the use of the PLST page and Bruce's generous code provision, using the search function and "mso" as the search term is helpful, as is spell check for finding places where words have been run together because line breaks from the text editor have been removed.

        Also, a note: This issue was discovered because the store owner hired a new ad agency and they remarked that multiple product descriptions were missing from the Google shopping feed. It was in troubleshooting the feed that I discovered what was going on. So if you're using the Rich Text Editor, and also have feeds set up, double check your feeds to be sure you aren't having issues with descriptions.

        Comment


          #19
          RE to Miva Team: Issues with product descriptions

          This is s pretty common occurrence. Any chance that at least the Product Update process could detect some of these issues? (i.e., character encoding/high order ascii characters, embedded pages, AKA <html><head></head> etc...
          Bruce Golub
          Phosphor Media - "Your Success is our Business"

          Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
          phosphormedia.com

          Comment


            #20
            Originally posted by Bruce - PhosphorMedia View Post
            RE to Miva Team: Issues with product descriptions

            This is s pretty common occurrence. Any chance that at least the Product Update process could detect some of these issues? (i.e., character encoding/high order ascii characters, embedded pages, AKA <html><head></head> etc...
            What to really do it justice, pop a warning when those tags are attempted to be added.
            Leslie Kirk
            Miva Certified Developer
            Miva Merchant Specialist since 1997
            Previously of Webs Your Way
            (aka Leslie Nord leslienord)

            Email me: [email protected]
            www.lesliekirk.com

            Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

            Comment


              #21
              Well, we first learned their was an issue when trying to import data to Excel, but had no idea what was causing it for a very long time, no one did, not even Miva.

              How did we identify which products where contaminated with the Word formatting codes? We identified a common Word formatting code contained in the description field <xml>.

              Since Word formatting codes was rendering Miva export files useless, we the used old Man Weiland's "Find and Replace" to locate every product that contained <xml> Word formatting code in the product description field. We then simply copied and pasted the entire search results to Excel and kept the product code column only, then added a second column and concatenated "https://www.site.com/[ProdCode].html to create a list product-corrupt-desc.csv file.

              We then use this list of corrupted product descriptions to scrape affected product pages using a data scrapping app for Chrome called Data Miner (amazing) to build us a new file (e.g.: Product Code, Product Title, Product Description with w/o HTML Codes and separate file with HTML codes. With the exception of looking for a great tool to scrape affected pages on our site frontend, everything else came together fast an easy, up to here.

              The problem then became finding another batch tool that would surgically remove unwanted Word formatting codes while retaining others so I can import them back into Miva. That is where I am currently stuck. Found some hit and miss tools online, others work great, but no batch solution.

              Suggestions anyone?

              Thank you, Bill Davis

              Comment


                #22
                I know there are some tools out there that will strip ALL html, but that would also mean no <p> tags. There might be one out there which allows you to preclude removal of certain one. Mivascript "stripHtml()" function does this, and a "Tool Page" could be created, but the actual steps here are beyond the scope of a forum post.
                Bruce Golub
                Phosphor Media - "Your Success is our Business"

                Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
                phosphormedia.com

                Comment


                  #23
                  The best cleaner that worked for us due to extensive MS Word formatting code was one of the simpler online solutions we came across called HtmlWasher. It worked 100% of the times.

                  They also have an upload option which I am testing.


                  Update:

                  Best Online MS Word to HMTL Decoder / Encoder Tool:

                  Professional Online HTML Editor | htmlg.com - Word Decoder / Encoder

                  https://htmlg.com/html-editor/
                  Last edited by William Davis; 12-24-21, 09:55 AM.
                  Thank you, Bill Davis

                  Comment


                    #24
                    Originally posted by William Davis View Post
                    The best cleaner that worked for us due to extensive MS Word formatting code was one of the simpler online solutions we came across called HtmlWasher. It worked 100% of the times.

                    They also have an upload option which I am testing.
                    I'll have to pass this one to a couple of store owners who still have a LOT of old copy & pasted "code" from Expressions.
                    Leslie Kirk
                    Miva Certified Developer
                    Miva Merchant Specialist since 1997
                    Previously of Webs Your Way
                    (aka Leslie Nord leslienord)

                    Email me: [email protected]
                    www.lesliekirk.com

                    Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

                    Comment

                    Working...
                    X