Jump to content
Sign in to follow this  
lee the bean

tinymce product desc editor & easy meta tags contribs

Recommended Posts

I'm using the easy meata tags contrib http://addons.oscommerce.com/info/6360 which uses the first 150 chars of the product description as the meta description tag (and this works fine).


I've just installed the tinymce editor contrb http://addons.oscommerce.com/info/5864 which allows html text editing in the categories script textarea (and this works fine).


However the tinymce adds a whole lot of html to the textarea like:


<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>Untitled document</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body><p align="justify"><font face="verdana,geneva"><font size="3"><strong>Title: </strong>


Where Title: is the first characters of the product description.


Does anyone know how to either setup tinymce to NOT add the <html><head> waffle - OR

strip this extra text out in the easy meta tags contrib with string substitutions?



(dont the extra <html><head><body> tags in the textarea conflict with the html page construction in tyhe php scripting anyway?)


I hope this makes sense! I'm a novice and always use the simplest contrib to do the simplest of tasks - and these 2 contribs are at my level.


Many thanks in advance.

Share this post

Link to post
Share on other sites

I've removed the fullpage plugin/settings in the categories.php and this has removed the html & head meta tags.

Half the problem fixed.


This leaves the following html text formatting in the product description:


<!--l version="1.0" encoding="utf-8--><p align="justify"><font face="verdana,geneva"><font size="3"><strong>Title: </ etc



Now for the easy meta tags contrib to work correctly all I need is a method of stripping the <> characters and all text between them out of the text strings.


I had previously (prior to tinymce install) done a simple <br> removal thus:


$Title = str_replace('<br>', ' ', $Title); and

$Description = str_replace('<br>', ' ', $Description);


is there a simple way of removing the html text formatting strings from the text string in the metatags.php file?

Share this post

Link to post
Share on other sites

Adding the following code to the metatags.php removes all occurences of html text formatting and adds a space between words where required:


After -


$Description = $product_desc['products_description'];


add these two lines


$Description = str_replace('<br />', ' ', $Description);

$Description = strip_tags($Description);



Now these two simple to install, 'does what is says on the label' contributions work well together.


I highly recommend them.


Problem fixed.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this