X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Want a WYSIWYG detailed description text area? (https://forum.x-cart.com/showthread.php?t=7407)

Emerson 05-02-2004 08:27 AM

Want a WYSIWYG detailed description text area?
 
Does anyone have a need for a WYSIWYG mod for your detailed description text area?

Here is what it looks like...

http://www.ewdhosting.com/images/xcart-wysiwyg.gif

If anyone wants it, I'll put a howto together ;)

adpboss 05-02-2004 08:46 AM

Emerson,

Only finished mods here. Post it!!!

Don't tease us!

;)

:D

Emerson 05-02-2004 09:11 AM

Hello everyone!
Just a little something you might find usefull.

After installation, you'll be able to use the Full Description are as a WYSIWYG editor. Kind of like FrontPage and Dreamweaver.

You can find details about it at http://www.interactivetools.com/products/htmlarea/documentation.html

Here we go...

First download the file from http://www.ewdhosting.com/htmlarea.zip

Unzip it to your computer and upload the entire 'htmlarea" folder into your xcart root directory (eg: /xcart/htmlarea )

Now open the following (according to your version) and add the following right in between the <head> and </head> tags...

Pro: open /xcart/skin1/admin/home.tpl
Gold: open /xcart/skin1/single/home.tpl

Code:

<head>
{literal}
<script language="Javascript1.2"><!-- // load htmlarea
_editor_url = "../htmlarea/"; // URL to htmlarea files
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera') >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
document.write(' language="Javascript1.2"></scr' + 'ipt>');
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
// --></script>
{/literal}

</head>


Now open /xcart/skin1/main/product_modify.tpl and add the following to the top of the file...

Code:

<script language="JavaScript1.2" defer>
editor_generate('fulldescr');
</script>


That should be it!

Now log into to admin and try to add or edit a product. Your detailed description box should be just like the screenshot in the first post ;)

70challenger 05-02-2004 11:10 AM

I could only find home.tpl in customer, fulfilment and single? Using the lastest 3.5 xcart version.

Emerson 05-02-2004 11:29 AM

That is weird!
You should definitely have that file in the admin directory.

adpboss 05-02-2004 11:31 AM

it's single/home.tpl

Emerson 05-02-2004 01:49 PM

Sorry about the mix up.
I have updated the howto to show which file to edit depending on your version of xcart ;)

POSDepot 05-04-2004 04:25 AM

htmlarea - working?
 
Looking for confirmation that someone else has this working?

I'm on 3.5.3 Gold and I can't seem to get the HTML editor to show up.

Randy

carlisleglass 05-04-2004 04:52 AM

I'm running v3.5.7 and it aint showing up on mine either !

Emerson 05-04-2004 04:54 AM

Please post the path to your xcart install and the path for the htmlarea directory.

POSDepot 05-04-2004 06:46 AM

Mine is

http://www.pointofsaledepot.com/store/customer/home.php

http://www.pointofsaledepot.com/store/htmlarea

Randy
3.5.3 Gold

jpsowin 05-04-2004 06:47 AM

Htmlarea is great, I've been doing this with x-cart for a while! It makes things alot easier for clients... I'm surprised RRF hasn't done this yet.

Emerson 05-04-2004 07:05 AM

The paths seem correct!
If you edited to correct files it should work.

Also, what browser and version are you using?

As mentioned in the author's website:
Б─╒ Version 2.03 - IE 5.5+ for Windows only

They have a BETA version 3 out now that should work with IE 5.5+ and most OS.

POSDepot 05-04-2004 08:36 AM

We are running WinXP and IE 6.

I can view the demo on the developers site but not in my admin area.

Here's the top of my product_modify.tpl

Quote:

{* $Id: product_modify.tpl,v 1.76.2.2 2004/01/08 14:48:58 svowl Exp $ *}
<script language="JavaScript1.2" defer>
editor_generate('fulldescr');
</script>
<script language="javascript">
window.name="prodmodwin";
</script>

{include file="main/popup_image_selection_js.tpl"}

{if $product.productid ne ""}
{assign var="last_location" value=$lng.lbl_product_modify}
{else}
{assign var="last_location" value=$lng.lbl_add_product}
{/if}
{ include file="location.tpl" last_location=$last_location }
{capture name=dialog}
<form name="modifyform" action="product_modify.php?productid={$product.pro ductid}" method=post enctype="multipart/form-data">
<table border=0 cellpadding="0">


Here's the top of my skin1/single/home.tpl

Quote:

{* $Id: home.tpl,v 1.64.2.1 2003/11/19 14:26:07 svowl Exp $ *}
{ config_load file="$skin_config" }
<html>
<head>
<title>{$lng.txt_site_title}</title>
{ include file="meta.tpl" }
<link rel="stylesheet" href="{$SkinDir}/{#CSSFile#}">
{literal}
<script language="Javascript1.2"><!-- // load htmlarea
_editor_url = "../htmlarea/"; // URL to htmlarea files
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera') >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
document.write(' language="Javascript1.2"></scr' + 'ipt>');
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
// --></script>
{/literal}
</head>
<body LEFTMARGIN=0 TOPMARGIN=0 RIGHTMARGIN=0 BOTTOMMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
{ include file="rectangle_top.tpl" }
{ include file="head.tpl" }



Anyone see errors that I'm not seeing?

Randy
Gold 3.5.3

Emerson 05-04-2004 08:53 AM

Randy,
Everything looks fine.
The only thing I can think of now is that the script is not seeing the htmlarea folder.
Try moving it or adjusting _editor_url = "../htmlarea/"; in home.tpl

PhilJ 05-04-2004 10:39 AM

It seems to work fine initially, then when I try and edit the same product again, it goes back to the normal textarea box, and I get a javascript error.

Something along the lines of

Quote:

Error: 'document.all[...]' is null or not an object

Anyone else experiencing the same?

This will be a godsend if I can get it working properly.

Using x-cart v3.5.2

PhilJ

Emerson 05-04-2004 11:00 AM

Phil,
I haven't see that one.

It seems that a couple of pleople are having the same problem but no solution :(

http://www.interactivetools.com/forum/gforum.cgi?guest=6305239&t=search_engine&do=search _results&search_...sername=&mh=25

DonB 05-04-2004 09:37 PM

This looks great especially since most of my providers don't have a clue about how to use HTML :D

Don

groovico 05-05-2004 04:47 AM

Word of warning, the latest versions of x-cart will remove the HTML tags in those fields, so the above mod shouldn't be installed on 3.5.6 or above until x-cart allow HTML fields again...

Emerson 05-05-2004 04:50 AM

groovico (got it right this time ;) )

I have it running on both a Gold and Pro 3.5.7 stores with no problems.
It seems that the HTML problem does not affect the Detailed Description area!

shan 05-05-2004 05:17 AM

Quote:

Originally Posted by groovico
Word of warning, the latest versions of x-cart will remove the HTML tags in those fields, so the above mod shouldn't be installed on 3.5.6 or above until x-cart allow HTML fields again...


http://forum.x-cart.com/viewtopic.php?t=10054&highlight=

guileroy 05-07-2004 01:32 AM

Hello,

I've just installed htmlarea on a 3.5.7 version and it seems to work, but I have to refresh the page few time in order to get the detailled description field with htmlarea, and if i refresh again the last version came ... strange ...

PhilJ 05-07-2004 12:51 PM

Update: now works for me after refreshing the page a few times :P

Also if you want to use it for updating the static pages...

find admin/main/page_edit.tpl

and stick

Code:

<script language="JavaScript1.2" defer>
editor_generate('pagecontent');
</script>


at the top.

John7 05-07-2004 12:53 PM

Well
 
I've actually had this mod working for months and months.

I was planning on posting it here one day but looks like you beat me to it.

I've also been working on implementing HTML Area into the category description area but whenever I do this the whole description field show sup blank. As an experiment I stuck in on the category meta tag area and it work. Strange huh?

If anyone is interested I've also got HTML area to work on the template editor and the html page creator. (but the built in html creator eats all the meta tags)

Oh also HTML Area may destroy your style sheets.


ALSO: I'd just like to thank all the masters such as FunkyDunk and the other for all their help and inspiration. FunkyDunk most of all since he's been such a great help and inspiration to me.


[/b]

Adian009 05-15-2004 01:24 PM

Fix for document.all issue
 
Put the call to editor_generate in the <td> for the full description - I am running 3.5.7 and it should look like this:

Quote:

<td valign="top" class=ProductDetails>
{* 5/14/2004 by Al Ponte: Added the following script to enable HTML Edit Area for full description. *}
<script language="JavaScript1.2" defer>
editor_generate('fulldescr');
</script>
{* 5/14/2004: END OF MOD SPACE. ADDED THIS BLOCK, JUST DELETE TO REMOVE. *}
<textarea name="fulldescr" cols="45" rows="10">
{ $product.fulldescr|replace:"
":"\n"|escape:"html"}</textarea>
</td>

I am having an issue - it keeps asking me if I want to display the insecure objects and I am using an HTTPS for my editor path. Any suggestions on that one?

--al ponte

nerd luv 06-01-2004 12:57 PM

Very useful time saver. Thank you!

POSDepot 06-01-2004 04:54 PM

Yup.

That works for me.

Thanks
Randy

junaid 06-02-2004 03:14 AM

works here also..thanks for such a nice mod

groovico 06-02-2004 04:21 AM

One thing to keep in mind when using HTML in your product descriptions is it can screw with the import/export via CSV. I've added various wysiwyg editors all over some of my clients x-cart sites and the export/import failed alot depending on what characters the html desc field had in it.

Royal pain in the bahookee!

Hope x-cart 4 has some additional exporting/importing options for the csv format by default.

GM 06-02-2004 08:44 AM

Code:

I am having an issue - it keeps asking me if I want to display the insecure objects and I am using an HTTPS for my editor path. Any suggestions on that one?

GM
in editor.js change line var richedit... to:

var RichEdit = '<iframe src="' + _editor_url + 'popups/blank.html' + '" ID="_' +objname+ '_editor" style="width:' +editor_obj.style.width+ '; height:' +editor_obj.style.height+ ';"></iframe>';


1) make the popups/blank.html not just "<html></html>"
but rather "<html><body></body></html>"

2) htmlarea.js: after this line:
var iframe = document.createElement("iframe");
(should be around line 376) the following:
iframe.src = this.popupURL("blank.html");

3) Fixing the same issue for the Spell Checker pluging:
3.1 cp popups/blank.html plugins/SpellChecker/
3.2 in plugins/SpellChecker/spell-check-ui.html
replace the line:
<iframe src="about:blank" width="100%" height="100%"
with the following:
<iframe src="blank.html" width="100%" height="100%"

I picked this up on some htmlarea forum.

electric 06-10-2004 06:21 PM

Quote:

Originally Posted by PhilJ
It seems to work fine initially, then when I try and edit the same product again, it goes back to the normal textarea box, and I get a javascript error.

Quote:

Error: 'document.all[...]' is null or not an object

Anyone else experiencing the same?


We are experiencing this exact same error. Is there a solution? We are using X-Cart version 3.5.8.

Any help would be greatly appreciated.

Emerson 06-10-2004 06:25 PM

Quote:

Originally Posted by electric
We are experiencing this exact same error. Is there a solution? We are using X-Cart version 3.5.8.

Any help would be greatly appreciated.


Phil had posted that refreshing the page a few times helped the problem! ;)

electric 06-11-2004 01:58 PM

Has anyone tried to get HTMLAREA to work with the "webmaster mode" for updating language variables in the little popup boxes?

This would be great if it works... but I have no idea how to do this.

Anyone?

mlannen@tecconvt.net 07-08-2004 11:50 AM

GREAT MOD THANKS!
 
This is a great Mod. Thanks so much. Took like 5 minutes to implement.

Rob 08-19-2004 09:46 AM

Has anyone figured out why sometimes you have to refresh the screen several times before htmlarea works? This was pointed out by several people, but a solution was never offered. The subject seems to have died out. Too bad, this was a great mod I wish I could get it to work consistantly. I've had to refresh the screen up to 6 times before it showed up.

version 3.4.8

mream 10-05-2004 02:56 PM

I have that same inconsistency problem. Any ideas?

Also, is there any way to put the HTMLAREA on the "page content" field when I create a static (embedded) page?

thanks,

PhilJ 10-05-2004 03:03 PM

yes Matt, read the previous page on this thread, half way down

mream 10-05-2004 08:33 PM

Thanks, Phil. Musta missed that!

PhilJ 10-06-2004 07:02 AM

np, also if you want to use it to update your welcome message

in skin1/admin/main/languages.tpl

at the top of the page add

Code:

<script language="JavaScript1.2" defer>
editor_generate('var_value[txt_welcome]');
</script>


Then add a link to skin1/admin/menu.tpl

Code:

Edit Welcome

to edit the text directly.

it's advisable to only use this after you have set all your other language variables, as it will cause a javascript error when editing other variables, although it's harmless.

CenturyPerf 10-07-2004 04:36 PM

Does anyone have this working in 4.0.4?

I set it up and I get no change (no errors either).

The HTMLAREA folder is in my main X-Cart directory and I added the scripts to the two pages listed in this thread. I've tried a variety of paths (../htmlarea /htmlarea/ /htmlarea) and no difference.


All times are GMT -8. The time now is 01:55 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.