Expand my Community achievements bar.

SOLVED

How to bold few words in a textfield

Avatar

Level 1

I need to bold few words in a texfield.

For example,

below are my XML

<paragraph>"Join with <b>Adobe enterprise products</b>. Access a vast library of learning content and <b>courses</b>, get personalized recommendations, and <b>connect with a vibrant community of fellow learners</b>".</paragraph>

And I change the field format to Rich text. But that doesn't help

 

I  was expecting for something like below. 

"Join with Adobe enterprise products. Access a vast library of learning content and courses, get personalized recommendations, and connect with a vibrant community of fellow learners".

 

 

But All I got is 

Join with <b>Adobe enterprise products</b>. Access a vast library of learning content and <b>courses</b>, get personalized recommendations, and <b>connect with a vibrant community of fellow learners</b>

 

I can only bold the entire text field. 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@angela95ry ,

If you are using sightly to display content on the webpage then please use context

${textfieldname @ context='html'}

 It  should display content in bold.

Please read more about sightly and context tokens here 

https://experienceleague.adobe.com/docs/experience-manager-htl/using/htl/expression-language.html?la...

 

Hope this helps!!!

 

Thanks,

Aruna

 

View solution in original post

7 Replies

Avatar

Community Advisor

Hi @angela95ry 

 

Are you trying to bold the tooltip or description in the dailog textfield or the text inside the text field?

 

For the primary case: https://stackoverflow.com/questions/4412395/is-it-possible-to-insert-html-content-in-xml-document

 

For the secondary case: https://gist.github.com/briankasingli/1a7e3e12deaa2e076645b09d30039b46

 

Hope this helps!

 

Thanks,

Kiran Vedantam.

Avatar

Level 1

I am try to bold few words of the text inside a text field.

I used the secondary case u suggest, change the XML to below:

<paragraph>"Join with &lt;b&gt;Adobe enterprise products&lt;b&gt;. Access a vast library of learning content and &lt;b&gt;courses&lt;b&gt;, get personalized recommendations, and&lt;b&gt;connect with a vibrant community of fellow learners&lt;b&gt;".</paragraph>

However, it doesn't change the outcome. I am still getting below as the value for the textfield. 

Join with <b>Adobe enterprise products</b>. Access a vast library of learning content and <b>courses</b>, get personalized recommendations, and <b>connect with a vibrant community of fellow learners</b>

 

Avatar

Level 1

but it's readonly field. So the data are from XML, and there is no edit option. 

Avatar

Correct answer by
Community Advisor

@angela95ry ,

If you are using sightly to display content on the webpage then please use context

${textfieldname @ context='html'}

 It  should display content in bold.

Please read more about sightly and context tokens here 

https://experienceleague.adobe.com/docs/experience-manager-htl/using/htl/expression-language.html?la...

 

Hope this helps!!!

 

Thanks,

Aruna

 

Avatar

Community Advisor

@angela95ry  As @Anny0505 has mentioned, you can use html context in HTL while displaying the content on the page. That way, whatever HTML tags you give in a text field will get applied on your page. If not it will be treated as a normal text.

 

Thanks

Veena ✌

Avatar

Community Advisor

Hi @angela95ry ,

                          You need to use your  text field@ context='html' then it will treated as html and it will display text properly on the page.

 

Kr,

Sanjay