[opencms-dev] access content in main.jsp (container pagetemplate)
Michael Emmerich
m.emmerich at alkacon.com
Tue Aug 16 17:48:04 CEST 2011
Hi Patric,
in our template III we use the a specific resource for both header and
footer. This resource is dropped directly into the containerpage, in our
case the model container page, so the header and footer are the same on
all container pages. Additionally there are two containers for header
and footer inside of the template jsp.
To add the header to the containterpage the resource is dropped into the
container of the template header of the model container page. Then the
resource is edited, so some content is added. Afterwards the same
resource is dropped into the template footer of the model container
page. The formatter of this xmlcontent differes between the container
names and makes the right output using ${cms.container.name ==
'headercontainer'}. Please compare the formatter jsp and the schema
definition in the OpenCms 8 Template 3 frontend Module:
/system/modules/com.alkacon.opencms.v8.template3/formatters/config.jsp
/system/modules/com.alkacon.opencms.v8.template3/schemas/config.xsd
So If you want to use a specific article for you header. You should
create a special container for the header in your template. Make the
article droppable into this container by impelemeting an own formatter
and specifying it in the article schema definition. Inside of the
formatter you can use the information provided by the article and
display it. Then drop the article to your containerpage.
I hope this helps.
Kind Regards,
Michael.
Am 16.08.2011 15:44, schrieb patric dosch:
> Hey Peter,
>
> I did not understand. I'll try it differently. I want to offer some
> settings in the header.
>
> Your template 3 has to its own content type. In my case, I would like to
> do that in my Article Content Type, this is indeed an element in the
> container. Therefore, I have only access to the content in the
> formatter, and not already in the container or page, right?
>
> Actually I wanted to do in the Article, because the settings are inherited.
>
> Greetings, Patric
>
> *Von:*opencms-dev-bounces at opencms.org
> [mailto:opencms-dev-bounces at opencms.org] *Im Auftrag von *Peter Sreckovic
> *Gesendet:* Dienstag, 16. August 2011 15:10
> *An:* opencms-dev at opencms.org
> *Betreff:* Re: [opencms-dev] access content in main.jsp (container
> pagetemplate)
>
> Hi Patric,
>
> if I get you right then the URI of the container page is passed to your
> function providing class instead of the URI of your content type within
> the container.
>
> In this case you might want to have a look at the already released OAMP
> Webform and / or Survey modules (as an example how to fix this).
>
> Perhaps you have to add a new constructor and pass the correct URI in
> the formatter JSP.
>
>
> Kind regards,
> Peter
>
>
> Am 16.08.2011 14:57, schrieb patric dosch:
>
> Hey List!
>
> Iwould like to offera
> configurableheaderformysite(imageandslogan).Untilnow I couldaccess all
> the contentin the template.With the newformatter-technique, Ijust do not
> knowhow.
>
> Iwouldlike todefine thesefieldsin myarticle-content type,butreadinthe
> container page template (main.jsp).Is thereperhapsanotherpossibility?
>
> Greetings, Patric
>
>
> _____________________________________________________________________
>
> Vorstand: Ralf Heller, Udo Mobes
> Vorsitzende des Aufsichtsrates: Kirsten Heller
> Sitz der Gesellschaft: Gruenwaelderstrasse 10-14, D-79098 Freiburg
> Amtsgericht Freiburg HRB 6218
>
> Versand am 16.08.2011 14:57 von dosch patric
> Validation-Code: 2256150024141
>
>
>
>
>
>
> _______________________________________________
>
> 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
>
>
>
> --
>
> Peter Sreckovic
>
>
>
> -------------------
>
>
>
> Alkacon Software GmbH - The OpenCms Experts
>
> Peter Sreckovic
>
> An der Wachsfabrik 13
>
> 50996 Koeln, DE
>
>
>
> Tel: +49 (0)2236 3826-0
>
> Fax: +49 (0)2236 3826-20
>
> Email:p.sreckovic at alkacon.com <mailto:p.sreckovic at alkacon.com>
>
>
>
> http://www.alkacon.com
>
> http://www.opencms.org
>
>
>
> Geschäftsführer: Alexander Kandzior, Amtsgericht Köln, HRB 54613
>
>
>
>
> _______________________________________________
> 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
--
Kind Regards,
Michael.
-------------------
Michael Emmerich
Alkacon Software GmbH - The OpenCms Experts
http://www.alkacon.com - http://www.opencms.org
More information about the opencms-dev
mailing list