[opencms-dev] Upgrade to OpenCMS 10: Template questions

Daniel Seidel d.seidel at alkacon.com
Wed Feb 1 11:49:25 CET 2017


Hi John,

your question has been not answered for ages. Sorry about that. I think 
the formatter configuration is the thing you were not aware about. You 
have a container of type "center". Configure your formatter to fit into 
containers of type "center". Then you should be able to place it in the 
container page using the template. If not, Either the schema or the 
formatter is incorrect. To evaluate this, try to add a content of the 
type via the explorer and try to edit it. It it works - schema is 
correct. To evaluate the formatter, just place <div>Hello</div> as 
formatter, put the content on the page (new content has to be edited to 
be stored), and then replace the formatter with the original version. 
The formatter will render - possibly showing an error.

Best, Daniel.


Am 21.04.2016 um 00:32 schrieb John Bieling:
> I am reading all the documentation I can find, but I am not able to 
> migrate my template. As a first step, I am trying to create a new and 
> very simple OpenCMS 10 template following
>
> http://documentation.opencms.org/opencms-documentation/creating-a-website/creating-a-template-jsp/
>
> I am lost at step 9.
>
> I now have a very simple container page template:
>
> <%@pagebuffer="none"session="false"trimDirectiveWhitespaces="true"%> 
> <%@ taglib prefix="cms"uri="http://www.opencms.org/taglib/cms"%> <%@ 
> taglib prefix="fmt"uri="http://java.sun.com/jsp/jstl/fmt"%> <%@ taglib 
> prefix="fn"uri="http://java.sun.com/jsp/jstl/functions"%> <%@ taglib 
> prefix="c"uri="http://java.sun.com/jsp/jstl/core"%> <html>     <head> 
>         <title>Test</title>         <cms:enable-ade />     </head>     
> <body>         <div id="HEADER">header</div>         <div 
> id="NAVIGATION">navigation</div>         <cms:container 
> name="CENTERCOLUMN" type="center" width="100" />         <div 
> id="FOOTER">footer</div>     </body> </html> The root folder of my 
> test site has a "template" property pointing to that container page 
> template. For the first test, I want to use a very simple custom 
> content type with the following schema: <xsd:schema 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> elementFormDefault="qualified">     <xsd:include 
> schemaLocation="opencms://opencms-xmlcontent.xsd"/>     <xsd:element 
> name="SimplePageTypes" type="OpenCmsSimplePageTypes"/>     
> <xsd:complexType name="OpenCmsSimplePageTypes">         <xsd:sequence> 
>             <xsd:element name="SimplePageType" 
> type="OpenCmsSimplePageType" minOccurs="0" maxOccurs="unbounded"/>     
>     </xsd:sequence>     </xsd:complexType>     <xsd:complexType 
> name="OpenCmsSimplePageType">         <xsd:sequence>             
> <xsd:element name="Menu" type="OpenCmsString" minOccurs="0" 
> maxOccurs="1" />             <xsd:element name="Author" 
> type="OpenCmsString" />             <xsd:element name="Release" 
> type="OpenCmsDateTime" />         </xsd:sequence>         
> <xsd:attribute name="language" type="OpenCmsLocale" use="optional" /> 
>     </xsd:complexType>     <xsd:annotation>         <xsd:appinfo> 
>             <mappings>                 <mapping element="Release" 
> mapto="attribute:datereleased" />                 <mapping 
> element="Menu" mapto="property:NavText" />             </mappings>     
>         <defaults>                 <default element="Author" 
> value="${currentuser.firstname} ${currentuser.lastname}"/>             
>     <default element="Release" value="${currenttime}"/>             
> </defaults>             <formatters>                 <formatter 
> minwidth="100" 
> uri="/system/modules/mymodule/formatters/container-formatter.jsp"/> 
>             </formatters>         </xsd:appinfo>     </xsd:annotation> 
> </xsd:schema> The formatter is also very simple and looks as follows: 
> <%@ taglib prefix="cms" uri=http://www.opencms.org/taglib/cms" %> 
> <cms:formatter var="content">     <div class="article">         
> <h1>${content.value.Menu}</h1>     </div> </cms:formatter> And now 
> what? I can create a new container page, but do not see how to link it 
> to my XSD /Resource-Type. It is not showing any "containers" or 
> anything to enter content. Any ideas? Thanks John
>
> _______________________________________________
> 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,
Daniel.
  
-------------------

Daniel Seidel

Alkacon Software GmbH & Co. KG - The OpenCms Experts
http://www.alkacon.com - http://www.opencms.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20170201/7e74094c/attachment.htm>


More information about the opencms-dev mailing list