[opencms-dev] HTMLWidget per site config

Mario Jäger m.jaeger at alkacon.com
Tue Aug 24 09:47:15 CEST 2010


Hi Tylla,

It is still not possible to configure a HtmlWidget per site.

But, you could implement your own widget. Thereto, you have to implement a class in your own module, which extends the class org.opencms.widgets.CmsHtmlWidget and which overwrites the method getEditorWidget(). 
In the line "editorWidget.setHtmlWidgetOption(getHtmlWidgetOption())" the widget options are set. This one line code you should split in your class then. Because, you have a CmsObject in this method, you can 
check the current site. One possibility is, that you change hard coded here the the CmsHtmlWidgetOption object dependent of the current site, if tables shall be able to use, before you set it to the A_CmsHtmlWidget 
object. You also could enhance the configuration string with a site statement, which is evaluated here. To use your own widget, you also have to add it in the OpenCms configuration file WEB-INF/config/opencms-vfs.xml.

-- 
Kind Regards,
Mario.
 
-------------------
Mario Jäger
 
Alkacon Software GmbH  - The OpenCms Experts                    
http://www.alkacon.com - http://www.opencms.org


Nagy Attila schrieb:
>   Hi everybody!
>
> I searched through the list and the wiki, but couldn't find a solution, 
> so here is my question, maybe someone can help me.
>
> Is it possible to configure the HTMLWidget on a per site basis?
>
> I mean, if I have two sites in one OpenCMS and I would like to configure 
> one site to be able to use tables in layoutpages, the other site not.
> All the solutions I found, were independent of the site currently 
> presented, and I wouldn't want to make two different modules of 
> layoutpage just to use them in the different sites (this would not scale 
> too well, at 10 sites I would have 10 modules and 10 different kind of 
> layoutpage structured content types just to solve this single problem).
>
> Thanks in advance,
> Tylla.
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
>   



More information about the opencms-dev mailing list