I don't know if this is one of the 11 ways. Use the [[email protected]/]  to
access information that is not in the current page/paragraph. You can access
the new content node by its page path if you do not have the UUID. This
method seems a bit more complex but it works for us. You do not need to add a
method in the model for this. But the disadvantage is that loadPage does not
make the content available in freemarker, so we need to create a variable
using cms.out .

For example, 'newnode' is under the page 'newpage'. 

In your current page, you can do -

[[email protected] path="${path/newpage}"/] 

[[email protected] contentNodeCollectionName="newnodeCollection" ]

<!--Load page does not make the content available in freemarker, so we need
to create a variable using cms.out -->

[[email protected] nodeDataName="newnode" var="mynewnode" /] 

This is the mynewnode ${mynewn...@name}

I can acess its properties ${mynewnode.title!}

[/@cms.contentNodeIterator] 


[[email protected] /]

Thanks,
Garima 

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Jan Haderka
Sent: Tuesday, January 26, 2010 9:49 AM
To: Magnolia User-List
Subject: RE: [magnolia-user] Access to another node from a Freemarker
paragraph


Hmm, Greg said there's about dozen ways to do this ... you guys have put
together already 3 different ways ... can anyone name the remaining
9 ... and get a free T-shirt at next Magnolia Conference? :D
(@Boris: hope it's ok)

Jan

On Tue, 2010-01-26 at 14:14 +0100, Matteo Pelucco (Tinext) wrote:
> Otherwise, if it would fit your needs, you can take a look at
MagnoliaTemplatingUtil.java.
> This class is exposed to Freemarker world with the name of "mgnl".
> So, for instance, you can have a page link with
> 
> ${mgnl.createLink('website', content.uuid)}
> 
> (output would be, for instance, 
> "http://your-domain/your-context/path-to-page-with-uuid.html";)
> 
> HTH,
> Matteo
> 
> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of Will 
> Scheidegger
> Sent: martedì, 26. gennaio 2010 07:58
> To: Magnolia User-List
> Subject: Re: [magnolia-user] Access to another node from a Freemarker 
> paragraph
> 
> 
> I have next to no Freemarker experience myself... but I thought one can use
the Magnolia cms and cmsu JSP tags in Freemarker (see [1]). That should make
things pretty easy.
> 
> -will
> 
> [1] http://freemarker.org/docs/pgui_misc_servlet.html#autoid_55
> 
> On 25.01.2010, at 22:26, Grégory Joseph wrote:
> 
> > 
> > There are about a dozen ways to do so; the cleanest approach would
probably be have a rendering model class attached to your paragraph, and get
the node from there.
> > 
> > On Jan 25, 2010, at 9:09 PM, Sjoerd Adema wrote:
> > 
> >> 
> >> Hi All,
> >> 
> >> How can i get access to another page node within a Freemarker template.
I have off course access to the current node exposed as a map and the current
page exposed as a map. But now within a paragraph I need some information of
a node for which I only have an uuid. How can I do that ?
> >> 
> >> TIA
> >> 
> >> Sjoerd Adema
> >> 
> >> ----------------------------------------------------------------
> >> For list details see
> >> http://www.magnolia-cms.com/home/community/mailing-lists.html
> >> To unsubscribe, E-mail to: <[email protected]>
> >> ----------------------------------------------------------------
> > 
> > 
> > ----------------------------------------------------------------
> > For list details see
> > http://www.magnolia-cms.com/home/community/mailing-lists.html
> > To unsubscribe, E-mail to: <[email protected]>
> > ----------------------------------------------------------------
> > 
> 
> 
> ----------------------------------------------------------------
> For list details see
> http://www.magnolia-cms.com/home/community/mailing-lists.html
> To unsubscribe, E-mail to: <[email protected]>
> ----------------------------------------------------------------
> 
> 
> ----------------------------------------------------------------
> For list details see
> http://www.magnolia-cms.com/home/community/mailing-lists.html
> To unsubscribe, E-mail to: <[email protected]>
> ----------------------------------------------------------------


----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------


----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to