[opencms-dev] Accessing File Contents

Dwayne Kristjanson dwayne at realdecoy.com
Mon Dec 11 22:42:35 CET 2006


I think it must be that I'm not in the correct context. I can identify the files, but not any of their contents. I was misspoke when I said the "correct title" loads.  I have no idea what I need to do after the contentload to get contentshow to grab the correct element. This is what isn't working right now:

<cms:contentload collector="allInFolderDateReleasedDesc"
                 param="/mysite/articles/|xmlpage"
                 editable="true">
<p>Contents of mainbox element in the file <cms:contentshow element="${opencms.filename}" /></p>
<div>
<cms:contentshow element="mainbox" />
</div>
</cms:contentload> 

The filename will show up correctly, but the contentshow for the element itself gives back "??? mainbox ???". I suppose this means I'm not in that page's context, but how do I switch?

(Oh, and thanks for the help. It's greatly appreciated.)

--
Dwayne Kristjanson

-----Original Message-----
From: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Fabian Huschka
Sent: Monday, December 11, 2006 4:24 PM
To: The OpenCms mailing list
Subject: Re: [opencms-dev] Accessing File Contents

Hello,

a piece of code will be helpful :-)


Basically use <cms:contentshow element="desired_element_name" /> however if you are in the wrong context, you may end up receiving question marks.


Regards,

Fabian

Dwayne Kristjanson schrieb:
> OK, I know this looks like a stupid question but how do I get access 
> to an element? I know that <cms:contentload /> and <cms:contentshow /> 
> are used for this somehow, but when I load a page with contentload and 
> pass then name of an element I _know_ exists in that page to 
> contentshow OpenCms barfs up "??? ElementName ???". What is going on 
> here? I'm using the same element name I defined in the template, and 
> the same name that shows up in the editor. I'm getting the right title 
> property, so I know I've loaded the right page. I just can't get the elements out.
>
> --
> Dwayne Kristjanson
>
> _______________________________________________
> 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
>
>   


--
componio GmbH
Robert-Bosch-Straße 7
D - 64293  Darmstadt
Tel:	+49.6151.500.367.11
Office:	+49.6151.500.367.0
Fax:	+49.6151.500.367.3
Internet: http://www.componio.net
E-Mail:	componio at componio.net


_______________________________________________
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