about how to add style in cq:text | Community
Skip to main content
srinivas_channa
New Participant
October 16, 2015
Solved

about how to add style in cq:text

  • October 16, 2015
  • 2 replies
  • 1560 views

I was referring the link
http://wem.help.adobe.com/enterprise/en_US/10-0/wem/howto/taglib.html


<cq:text value="textmessage" tagName="h2"  placeholder="textvalue" default="textvalue"  />

it renders as 
<h2>textmessage</h2>

but i would want to render it as

<h2 style="text-align: center;">textmessage</h2>

please let me know how could i acheive it

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by JustinEd3

You can't do this with the <cq:text> tag. If you wanted to use the <cq:text> tag, you would have to do this through a CSS class (i.e. the tagClass attribute).

2 replies

JustinEd3Accepted solution
Employee
October 16, 2015

You can't do this with the <cq:text> tag. If you wanted to use the <cq:text> tag, you would have to do this through a CSS class (i.e. the tagClass attribute).

Runal_Trivedi
New Participant
October 16, 2015

If you are using RTE then you can use Justify or Styles plugin for the same.

 

If you are not using RTE then you can have a tab and a widget of xtype - componentstyles.

With component styles you can provide options to wrap the content of component with custom styles.

Take a look at foundation textimage component (/libs/foundation/components/textimage/dialog/items/tab4)

  • Drag textimage component in parsys container of any geometrixx page made with template Geometrixx Content Page (http://localhost:4502/cf#/content/geometrixx/en/services.html)
  • Open the dialog and observe Styles Tab
  • Values of styles tab comes from its design level configuration which is present at - /etc/designs/geometrixx/jcr:content/contentpage/par/textimage/cq:styles

the styles that you select while configuring content that style class gets placed in your autogenerated CQ Div tag.

Hope it helps.

- Runal