Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
How can I access to a content attribute inside a showlet?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
dalborgo  
View profile  
 More options Jan 11, 11:41 am
From: dalborgo <ma...@dalborgo.it>
Date: Wed, 11 Jan 2012 08:41:02 -0800 (PST)
Local: Wed, Jan 11 2012 11:41 am
Subject: How can I access to a content attribute inside a showlet?
Hi, I'm Marco Dal Borgo, I'm an Italian student.

I use JAPS 2.0 and i have a trouble.

I'm tring to access to a content attribute in a showlet with no
result.
For example this is my code (showlet.jsp)

<c:forEach var="content" items="${contentList}" begin="0" end="3">
                <jacms:content contentId="${content}" modelId="12" />
</c:forEach>

It renders my content with a specific content model. How can I have
access to an attribute of the content?
When I define a content model it's very easy to do that, just typing
$content.attribute.text. Is there one way to do it Inside a showlet
definition?

Thanks.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Giovanni Cocco  
View profile  
 More options Jan 16, 5:54 am
From: Giovanni Cocco <gianni.g.co...@gmail.com>
Date: Mon, 16 Jan 2012 11:54:26 +0100
Local: Mon, Jan 16 2012 5:54 am
Subject: Re: [jAPS-Platform] How can I access to a content attribute inside a showlet?

2012/1/11 dalborgo <ma...@dalborgo.it>

> Hi, I'm Marco Dal Borgo, I'm an Italian student.

Hi Marco,

The right way to access an attribute is with a model for proper rendering
of the content. The tag jacms:content is to show a content rendered with a
proper model. You have to do some development to load a content in the page
context (as a not rendered entity) and to access is attributes.

> Thanks.

GC


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
elia mezzano  
View profile  
 More options Jan 16, 6:18 am
From: elia mezzano <eliamezz...@gmail.com>
Date: Mon, 16 Jan 2012 12:18:37 +0100
Local: Mon, Jan 16 2012 6:18 am
Subject: Re: [jAPS-Platform] How can I access to a content attribute inside a showlet?

Hi Marco,
I suggest you to read this guide
http://dev.japsportal.org/trac/wiki/DocumentationTechnicalBuildingAWe...
In particular, at
http://dev.japsportal.org/trac/wiki/DocumentationTechnicalBuildingAWe...
you can find an example for a generic content type.
Regards

Elia

2012/1/11 dalborgo <ma...@dalborgo.it>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dalborgo  
View profile  
 More options Jan 16, 7:52 am
From: dalborgo <ma...@dalborgo.it>
Date: Mon, 16 Jan 2012 04:52:19 -0800 (PST)
Local: Mon, Jan 16 2012 7:52 am
Subject: Re: How can I access to a content attribute inside a showlet?
I understand, thanks.
I can access to the attribute defined as 'title' with this code:

<c:forEach var="content" items="${contentList}">
                        <jacms:content contentId="${content}"
attributeValuesByRoleVar="role" />
                        ${role['jacms:title'][currentLangVar]}
</c:forEach>

I hope to do something similar with all attribute.

On 16 Gen, 11:54, Giovanni Cocco <gianni.g.co...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eugenio Santoboni  
View profile  
 More options Jan 16, 11:26 am
From: Eugenio Santoboni <eugenio.santob...@gmail.com>
Date: Mon, 16 Jan 2012 17:26:59 +0100
Local: Mon, Jan 16 2012 11:26 am
Subject: Re: [jAPS-Platform] Re: How can I access to a content attribute inside a showlet?

Congratulations!!!

But pay attention that the "title" can be stored also into a mono-language
attribute (not only multi-language).
So, the code would be:

...
...
<c:forEach var="content" items="${contentList}">
<jacms:content contentId="${content}"
attributeValuesByRoleVar="attributeValuesVar" />

<c:if test="${null != attributeValuesVar}">
<c:catch var="exceptionMap"><wp:info key="currentLang" var="currentLangVar"
/><c:set var="titleVar"
value="${attributeValuesVar['jacms:title'][currentLangVar]}" /></c:catch>
<c:if test="${null != exceptionMap}"><c:set var="titleVar"
value="${attributeValuesVar['jacms:title']}" /></c:if>
</c:if>
${titleVar}
</c:forEach>
...
...

Eu

2012/1/16 dalborgo <ma...@dalborgo.it>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dalborgo  
View profile  
 More options Jan 16, 2:01 pm
From: dalborgo <ma...@dalborgo.it>
Date: Mon, 16 Jan 2012 11:01:23 -0800 (PST)
Local: Mon, Jan 16 2012 2:01 pm
Subject: Re: How can I access to a content attribute inside a showlet?
Thank you so much!

On Jan 16, 5:26 pm, Eugenio Santoboni <eugenio.santob...@gmail.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »