Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Rochad Tlusty
Messageboard BBcode parsing
July 24, 2012 1:24 PM
Answer

Rochad Tlusty

Rank: Junior Member

Posts: 42

Join Date: January 18, 2012

Recent Posts

Im currently writing a plugin for CKEditor, which uses a custom bbcode tag. Inside the editor, everything works fine, it's being displayed properly and I can see the bbcode tags being stored in the database. The problem is when I go to view a thread that has a tag published with this plugin, Liferay doesn't seem to parse the custom bbcode tag. So I started looking around and I found this article on the BBcode implementation for Liferay. Now it looks like I will need to replace com.liferay.portal.kernel.parsers.bbcode.BBCodeTranslatorUtil. I was just wondering if anyone had some input on this, for example can I implement this without using the ext environment? Any help is very greatly appreciated.
Jelmer Kuperus
RE: Messageboard BBcode parsing
July 24, 2012 3:26 PM
Answer

Jelmer Kuperus

Rank: Liferay Legend

Posts: 1192

Join Date: March 10, 2010

Recent Posts

If you want to use a different implementation of BBCodeTranslator then yes you'll need to use an ext plugin

In docroot/WEB-INF/ext-impl/src/META-INF/ you create a file called ext-spring.xml

 1<?xml version="1.0" encoding="UTF-8"?>
 2
 3<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
 4    <bean id="com.liferay.portal.kernel.parsers.bbcode.BBCodeTranslatorUtil" class="com.liferay.portal.kernel.parsers.bbcode.BBCodeTranslatorUtil">
 5        <property name="BBCodeTranslator">
 6            <bean class="com.yourcompany.YourImpl" />
 7        </property>
 8    </bean>
 9</bean


com.yourcompany.YourImpl you create under docroot/WEB-INF/ext-impl/src
Rochad Tlusty
RE: Messageboard BBcode parsing
July 25, 2012 8:05 AM
Answer

Rochad Tlusty

Rank: Junior Member

Posts: 42

Join Date: January 18, 2012

Recent Posts

Thank you Jelmer this is perfect! I really appreciate your help.