How to bold few words in a textfield | Community
Skip to main content
September 22, 2021
Solved

How to bold few words in a textfield

  • September 22, 2021
  • 4 replies
  • 2035 views

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. 

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 Anny0505

@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?lang=en

 

Hope this helps!!!

 

Thanks,

Aruna

 

4 replies

Kiran_Vedantam
Community Advisor
Community Advisor
September 22, 2021

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.

September 22, 2021

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>

 

Kiran_Vedantam
Community Advisor
Community Advisor
September 22, 2021

Hi @angela95ry 

 

If you are using the textfield as RTE, you can use the bold plugin

 

https://experienceleague.adobe.com/docs/experience-manager-64/administering/operations/rich-text-editor.html?lang=en

 

Thanks,

Kiran Vedantam.

Anny0505
Community Advisor
Anny0505Community AdvisorAccepted solution
Community Advisor
September 22, 2021

@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?lang=en

 

Hope this helps!!!

 

Thanks,

Aruna

 

VeenaVikraman
Community Advisor
Community Advisor
September 23, 2021

@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 ✌

Sanjay_Bangar
Community Advisor
Community Advisor
September 23, 2021

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