[opencms-dev] issue with content manager
Filip Kratochvil
filip.kratochvil at nelasoft.cz
Tue Jul 7 13:27:36 CEST 2015
Hi,
best way is look into demo modules (com.alkacon.bootstrap.formatters and com.alkacon.bootstrap.schmas), you will understand it really quickly.
Or watch this source code:
https://github.com/alkacon/modules-v8/tree/branch_9_5_x/modules/com.alkacon.bootstrap.formatters/resources/system/modules/com.alkacon.bootstrap.formatters
- containerpage just describes which xmlcontent is placed in which container
- containerpage is rendered using main template
- so you need to create template, some containerpage a and some xmlcotents
- than place xmlcontent on the page (position will be written in to the containerpage)
- xmlcontent will be rendered using fomatter (here is placed code for fetching data from xmlcontent)
- you can place more elements (it means xmlcontents) in one container, you can create more containers in your template (from version 9.5 you can create nested containers – they can be placed in formatters, not only in main template…)
Example of main template:
<%@page buffer="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" %><%--
--%><fmt:setLocale value="${cms.locale}" /><!DOCTYPE html>
<html lang="en">
<head>
<title>OpenCms | ${cms.title}</title>
</head>
<body>
<cms:container name="centercontainer" type="center" width="500" maxElements="8" detailview="true"/>
</body>
</html>
Example of xmlcontent formatter:
<%@page buffer="none" session="false" trimDirectiveWhitespaces="true" %>
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<cms:formatter var="content" val="value" rdfa="rdfa">
<div class="contentBox">
<div class="innerBox">
<div class="contentTitle">}>${value.Headline}</div>
<div class="contentText">}>${value.Text}</div>
</div>
</div>
</cms:formatter>
Look at the demo modules;)
--
S pozdravem / Regards
Filip Kratochvil
------------------------------------------------
NELASOFT Technologies, s.r.o.
E-mail: filip.kratochvil at nelasoft.cz
Web: www.nelasoft.cz <http://www.nelasoft.cz/>
Twitter: @NELASOFT <https://twitter.com/NELASOFT>
From: Ashish Shekhar [mailto:ashish.shekharcsc at gmail.com]
Sent: Tuesday, July 07, 2015 12:44 PM
To: The OpenCms mailing list; filip.kratochvil at nelasoft.cz
Subject: Re: [opencms-dev] issue with content manager
Thanks Filip. I am able to add empty container into the containerpage.
I am able to add the content on the page through empty container but I want to add content between the HTML element.
How can I make it dynamic. The Title and content marked yellow below should be fetch by content type.
<div class="contentBox">
<div class="innerBox">
<div class="contentTitle">The Title of an Article</div>
<div class="contentText">
<p>You may use this template on any site, anywhere, for free just please</p><br />
</div>
</div>
</div>
I have replaced the above whole piece of html with <cms:container name="centercontainer" type="center" width="500" maxElements="8" detailview="true"/> for which I am able to drag and drop of user defined content type. How can I make it dynamic so that the proper alignment and css would be implemented and content looks good.
Could you please point to the right tutorial/guide? Any example would be helpful.
Thanks,
Ashish
On Tue, Jul 7, 2015 at 1:36 PM, Filip Kratochvil <filip.kratochvil at nelasoft.cz> wrote:
Hi Ashish, try to add empty container into your containerpage (only fill container name and type).
--
S pozdravem / Regards
Filip Kratochvil
------------------------------------------------
NELASOFT Technologies, s.r.o.
E-mail: filip.kratochvil at nelasoft.cz
Web: www.nelasoft.cz <http://www.nelasoft.cz/>
Twitter: @NELASOFT <https://twitter.com/NELASOFT>
From: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Ashish Shekhar
Sent: Tuesday, July 07, 2015 9:33 AM
To: The OpenCms mailing list
Subject: Re: [opencms-dev] issue with content manager
Anyone have idea on this?
-Ashish
On Mon, Jul 6, 2015 at 9:26 PM, Ashish Shekhar <ashish.shekharcsc at gmail.com> wrote:
I am trying to create a webpage from scratch. I have followed the steps for creating the template and for body content I have replaced html with <cms:container>
which should enable the content manager to place elements easily via “drag & drop”.
<cms:container name="centercontainer" type="center" width="500" maxElements="8" detailview="true"/>
After placing this, no drag & drop features are enabled. Could anyone please help, what could the reason?
Thanks,
Ashish
_______________________________________________
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20150707/c2c9185f/attachment.htm>
More information about the opencms-dev
mailing list