Post by JNeuhoff » Fri Dec 12, 2008 9:18 pm

I have tested OpenCart 0.7.9RC5 and came accross the following problem for the Category Description addon which I am trying to get to work for this latest OpenCart release. If I enter a description using the FCKEditor, e.g.

Code: Select all

<p>This is the Category 1 description.</p>
<p> </p>
and save it, it always ends up in the database like this:

Code: Select all

<p>This is the Category 1 description.</p>
<p>
I am using this in the admin/controller/category.tpl file, which is similar to what we use in e.g. admin/controller/product.tpl:

Code: Select all

  ....
  <script type="text/javascript"><!--
  var sBasePath           = document.location.href.replace(/index\.php.*/, 'javascript/fckeditor/');
  <?php foreach ($categories as $category) { ?>
  var oFCKeditor          = new FCKeditor('description<?php echo $category['language_id']; ?>');
      oFCKeditor.BasePath = sBasePath;
      oFCKeditor.Value    = document.getElementById('description<?php echo $category['language_id']; ?>').value;
      oFCKeditor.Width    = '600';
      oFCKeditor.Height   = '300';
      oFCKeditor.Config['CustomConfigurationsPath'] = oFCKeditor.BasePath + 'myconfig.js';
      oFCKeditor.Config['DocType'] = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">';
      oFCKeditor.Config['SkinPath'] = oFCKeditor.BasePath + 'editor/skins/silver/' ;
      oFCKeditor.ToolbarSet = 'Custom' ;
      oFCKeditor.ReplaceTextarea();
  <?php } ?>
  //--></script>
  .....
Any ideas on how I can fix the category.tpl or the FCKEditor?

MHC Web Design
Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * TrustPilot Reviews * Google Rich Snippets * Google Tag Manager * Export/Import Tool * Template Switcher PHP/Twig


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by Qphoria » Fri Dec 12, 2008 9:24 pm

I will assume that because this is a contrib problem, you will assume that we would immediately reply with "This is not an opencart bug, its a contrib bug".

But I think you would know that so perhaps there is a higher reason to posting it here, maybe there is something in opencart that has made you suspect? Or are you just doing everything that product is doing inside category but you are getting different problems?

Did you also make the changes to use $request->gethtml, and the changes to use html_entity_decode, etc?
Last edited by Qphoria on Fri Dec 12, 2008 9:27 pm, edited 1 time in total.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by JNeuhoff » Fri Dec 12, 2008 10:48 pm

I got it now to work again :)

I changed all the $request->get(...) with the $request->gethtml(...), and I am also using the new validate class where possible. I'll upload an updated version of the Category Description contribution to the OpenCart site in a moment.

The category.tpl file now contains this near the end:

Code: Select all

  ....
  <script type="text/javascript"><!--
  var sBasePath           = document.location.href.replace(/index\.php.*/, 'javascript/fckeditor/');
  <?php foreach ($categories as $category) { ?>
  var oFCKeditor<?php echo $category['language_id']; ?>          = new FCKeditor('description<?php echo $category['language_id']; ?>');
      oFCKeditor<?php echo $category['language_id']; ?>.BasePath = sBasePath;
      oFCKeditor<?php echo $category['language_id']; ?>.Value    = document.getElementById('description<?php echo $category['language_id']; ?>').value;
      oFCKeditor<?php echo $category['language_id']; ?>.Width    = '600';
      oFCKeditor<?php echo $category['language_id']; ?>.Height   = '300';
      oFCKeditor<?php echo $category['language_id']; ?>.Config['CustomConfigurationsPath'] = oFCKeditor<?php echo $category['language_id']; ?>.BasePath + 'myconfig.js';
      oFCKeditor<?php echo $category['language_id']; ?>.Config['DocType'] = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">';
      oFCKeditor<?php echo $category['language_id']; ?>.Config['SkinPath'] = oFCKeditor<?php echo $category['language_id']; ?>.BasePath + 'editor/skins/silver/' ;
      oFCKeditor<?php echo $category['language_id']; ?>.ToolbarSet = 'Custom' ;
      oFCKeditor<?php echo $category['language_id']; ?>.ReplaceTextarea();
  <?php } ?>      
  //--></script>
  ....
Last edited by JNeuhoff on Fri Dec 12, 2008 10:50 pm, edited 1 time in total.

MHC Web Design
Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * TrustPilot Reviews * Google Rich Snippets * Google Tag Manager * Export/Import Tool * Template Switcher PHP/Twig


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by Qphoria » Fri Dec 12, 2008 11:55 pm

Good. I am going to move this out of bug reports since its not yet part of OpenCart's core. But the plan is to add it to 0.8

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: No registered users and 2 guests