Quantcast
Channel: Adobe Community : Popular Discussions - CQ5 (read only)
Viewing all articles
Browse latest Browse all 12476

How to make a text as a CQ component?

$
0
0

Hi,

 

I am a newbee in CQ development, so please bear with me if I ask too obvious question.

 

I created a template which diplays a title and summary of page in WCM be below.

I originally put these two values of properties into each page node using CRXDE Lite.

 

------template.jsp---------------------------------------------------------------

<% String currentTitle = currentPage.getTitle();

String summary = currentPage.getProperties().get("summary",""); %>

 

<h1><%=currentTitle%></h1>

<p><%=summary%></p>

 

-----------------------------------------------------------------------------------

 

It successfully display the title for each pages in WCM structure. However, when I click into a page from WCM.

I cannot edit the content of summary as I can edit using a CQ component of text. If I want to edit I have to go back to CRXDElite and

browse the page's jcr:content and find the summary property to edit it.

 

I tried this.

 

-------template.jsp(what I  tried)-----------------------------------------------

<% String currentTitle = currentPage.getTitle();

String summary = currentPage.getProperties().get("summary",""); %>

 

<h1><%=currentTitle%></h1>

<cq:text property="text"/>

<p><%=summary%></p>

-----------------------------------------------------------------------------------

But it displays CQ component and my text seperately.

 

 

 

Is there anyway I can do this like this?

 

<cq:text property="text" value="<%=summary%>"/>


Viewing all articles
Browse latest Browse all 12476

Trending Articles