I have a template which has a General Link field CTA. Raw Value for CTA Field:

<link text="Learn More" anchor="" linktype="internal" class="" title=""  querystring="" id="{6D341FAF-E786-4651-B3B2-6EC826175C18}" />

While creating a rendering variant I want to render the General Link field as below.

 <a class="link" href={{ i_item.CTA.target }}>{{i_item.CTA.text}}
    <span class="hidden"> {{ i_item.Title}}</span>

I need to access the text field that has the value "Learn more". But using i_item.CTA.text is not returning any value

I cannot use {{ sc_field i_item 'CTA' [['class', ("link")]] }} or {{ i_item.CTA}} because I want to encapsulate a tag inside the Link field. Is there a way to access the text in the General Link field in Scriban


Browse other questions tagged or ask your own question.