1

I am trying to read the url value of Link field of Link item, append it with a query string and render the same as link. Below scriban does not work for the same. Any help please?

{{ for i_child in (sc_query i_page "query:/sitecore/content/mysite/Data/Links/Global Links/appointments")

baseLink =i_child.Link.Url
scopeid=i_page.SearchScope.Id
href = baseLink+'#s='+scopeid 
sc_field i_child 'Link' [['href', href]]
break
{{end}}
0
1

In Scriban we have an embedded function sc_link here you can find more details about it: sc_link

An example how to use it :

<a href="{{ sc_link i_datasourceItem }}">{{ i_datasource.display_name }}</a>
1
  • The above scriban would work for the datasource item's display value, but not to retrieve the url of Link field in a link item. After reading most of the posts I understood it is not OOTB way hence wrote a scriban extension to achieve the same. – Christopher Raja Jan 28 at 18:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.