[opencms-dev] Drag and Drop Custom Content Type into Container
杨光
sun.java at 163.com
Fri Jul 13 05:37:06 CEST 2012
I think you could do something like following:
1. check opencms.log if there are some errors.
2.if there is no error, write some words arround cms:formatter, like:
<cms:formatter var="content" val="value">
please, show
</cms:formatter>
maybe it displays the whitespace we cann't see.
*******************************************
At 2012-07-13 10:47:41,"Ying Kwan Lam" <conniesookie at gmail.com> wrote:
Hi Michael,
Thanks for your reply first. I listed my detail information below.
The following is my template.jsp file (inside /system/modules/my.module.poll/templates directory),
....
<div id="main">
<div id="leftColumn">
<cms:container name="leftcontainer" type="left" width="230" maxElements="8"/>
</div>
<div id="centreColumn">
<cms:container name="centrecontainer" type="centre" width="450" maxElements="8" detailview="true"/>
</div>
<div id="rightColumn">
<cms:container name="rightcontainer" type="right" width="320" maxElements="8"/>
</div>
</div>
....
Under the /site/default/flower_en/, there is an index.html whose type is containerpage.
I edit the property and set the "template" property as /system/modules/my.module.poll/templates/template
------------------------------------------------------
In the /system/modules/my.module.poll/formatters directory, the detail.jsp is like that:
<%@page buffer="none" session="false" taglibs="c,cms" %>
<cms:formatter var="content" val="value">
</cms:formatter>
--------------------------------------------------------
In my XSD file, there is the formatters declaration.
<formatters>
<formatter maxwidth="450" uri="/system/modules/my.module.poll/formatters/detail.jsp" searchcontent="true" />
</formatters>
I set the maxwidth="450", then the newly-created content type should be added to the one of the containers defined in the template.jsp. However, the content type still cannot be added to the containers.
Actually, I read the wiki "Creating Plug and Play Modules for OpenCms8" (http://www.opencms-wiki.org/wiki/Creating_Plug_and_Play_Modules_for_OpenCms_8)
Also, I tried to add an attribute type="*" in the formatter tag. It doesn't work to add the customized content type into the containers.
Thanks for your kind attention.
Best Regards,
Connie Lam
2012/7/12 Michael Emmerich <m.emmerich at alkacon.com>
Hi,
you should check the following:
1) If your formatter jsp would cause an error, it could not be dropped into a container. You might some more info in the opencms.log.
You could try to remove everything from the formatter except the formatter tag to see if this works.
2) How did you define the formatters in the XSD? Maybe the width/name information does not fit to any of the containers on your page.
Kind Regards,
Michael.
Hi everyone,
I am an OpenCms beginner. I am currently using OpenCms 8.0.4. I wanna
create a new Content type for users to drag and drop.
I successfully created my new resource type via the following steps.
1. Create a module named my.module.poll under /system/modules/
2. Get into /system/modules/my.module.poll/schemas, create an XSD file
to define the schema named as poll.xsd
3. Add my formatter (.jsp file with formatter tag) under
/system/modules/my.module.poll/formatters
4. Go to opencms_modules.xml file to add two more elements (e.g.
resourecetypes and exploretype)
5. Create a workplace.propertes file to name the label under
/system/modules/my.module.poll/my/module/poll
6. Export the module and publish the module
7. Re-start the tomcat.
Actually, the new resource type is created. I have no problem up to now.
I tried to make the resource type as the content type.
That mean I can use the drag and drop feature to create a new Poll
content in container
2. Go to /system/modules/my.module.poll
2. Create a module config file named as .config and set the Resource
Type information such as Type name, Folder and Name Pattern
3. Go the the folder e.g. /site/default/flower_en/.content
4. Edit the .config file (adding the newly-created resource type)
Now, I went to flower_en webpage and I can find the Poll content shown
in the content list after clicking "Add Content" icon.
However, no container support the newly-created content type.
That mean, no container is highlighted to let me drag and drop
newly-created Poll content.
Please kindly tell me what I am missing.
Is my concept correct to create a new content type?
Thanks for your kind attention.
--
Best Wishes,
Connie Lam
_______________________________________________
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/cgi-bin/mailman/listinfo/opencms-dev
--
Kind Regards,
Michael.
-------------------
Visit OpenCms Days 2012 Conference and Expo September 24 to 25, 2012 in Cologne, Germany http://www.opencms-days.org
Michael Emmerich
Alkacon Software GmbH - The OpenCms Experts
http://www.alkacon.com - http://www.opencms.org
_______________________________________________
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/cgi-bin/mailman/listinfo/opencms-dev
--
Best Wishes,
Connie Lam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20120713/9d540a8b/attachment.htm>
More information about the opencms-dev
mailing list