Expand my Community achievements bar.

SOLVED

about how to add style in cq:text

Avatar

Level 2

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

1 Accepted Solution

Avatar

Correct answer by
Employee

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).

View solution in original post

2 Replies

Avatar

Correct answer by
Employee

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).

Avatar

Level 7

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