Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Fckeditor ProtecedSource and block tags
 
Richard H
Jr. Member
 
Total Posts:  12
Joined:  2008-04-07
 

I’ve implemented fckeditor, but now when I add blocks like

{{block type="catalog/product_view" product_id="1" template="catalog/product/view.phtml"}}
fckeditor changes the “ to
quot;

There seems to be an option in Fckeditor, called ProtectedSource which takes a RegExp patern. I’ve added this

FCKConfig.ProtectedSource.Add( /{\{.*?\}\} /);
to the fckconfig.js but it doesnt seem to do anything.
 
Magento Community Magento Community
Magento Community
Magento Community
 
GazT
Jr. Member
 
Total Posts:  1
Joined:  2008-10-01
 

Hi Richard,

I had the same problem and eventually came up with a quick fix, just use single quotes instead of double quotes ( ‘ instead of “ )
This cleared the problem right up for me. Hope this helps!

Gary

 
Magento Community Magento Community
Magento Community
Magento Community
 
clorne
Sr. Member
 
Total Posts:  236
Joined:  2008-01-10
London
 

Hi Richard

Your code was fine but there was a space before the /g that stops it working

FCKConfig.ProtectedSource.Add( /{\{.*?\}\} /);

it should quite simply be

FCKConfig.ProtectedSource.Add( /{\{.*?\}\}/);

regards

 
Magento Community Magento Community
Magento Community
Magento Community
 
martin_klima
Jr. Member
 
Total Posts:  7
Joined:  2008-07-09
 

Here is my solution for magento block protection in fckeditor.
1) Open config file fckconfig.js (ex. magento_folder/fckeditor_folder/fckconfig.js)
2) find FCKConfig.ProtectedSource.Add section
3) add this line:

FCKConfig.ProtectedSource.Add( /\{\{.*\}\}/gi ) ;    // Magento block protection
4) save file

All characters between {{ and }} in your code for example

<a href="{{store url=""}}example">example</a>
will be protected.
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top