Skip to main content
deleted 1 character in body
Source Link
Michael West
  • 18.6k
  • 2
  • 42
  • 105

I solved this problem by extending a link tool we built (initially for NVelocity) for Scriban. A member of the community shows how to do the migration here.

Here you can see several methods exposed to help build the various parts of the link.

<div class="field-link">
    {{ $linkUrl =  sc_linkTool.get_field_link_url i_item "Link" }}
    {{ $title = sc_linkTool.get_field_link_title i_item "Link" }}
    {{ $target = sc_linkTool.get_field_link_target i_item "Link" }}
    {{ $class = sc_linkTool.get_field_link_class i_item "Link" }}
    <a href="{{ $linkUrl }}" rel="noopener noreferrer" title="{{ $title }}" target="{{ $target }}"><i class="{{ $class }}"></i></a>
</div>

Not yet complete...

In the middle of converting to the new way

The "Link Description" is blank because I no longer need it for this use case.

enter image description here


Initially we stored the unicode text in the "Link Description" but it appears that sometime after Sitecore 8.2.7/SXA 1.7.0 the text is html encoded. This meant that our previous approach using a VariantField to render the Link field would no longer work.

enter image description here

enter image description here

I solved this problem by extending a link tool we built (initially for NVelocity) for Scriban. A member of the community shows how to do the migration here.

Here you can see several methods exposed to help build the various parts of the link.

<div class="field-link">
    {{ $linkUrl =  sc_linkTool.get_field_link_url i_item "Link" }}
    {{ $title = sc_linkTool.get_field_link_title i_item "Link" }}
    {{ $target = sc_linkTool.get_field_link_target i_item "Link" }}
    {{ $class = sc_linkTool.get_field_link_class i_item "Link" }}
    <a href="{{ $linkUrl }}" rel="noopener noreferrer" title="{{ $title }}" target="{{ $target }}"><i class="{{ $class }}"></i></a>
</div>

Not yet complete...

In the middle of converting to the new way

The "Link Description" is blank because I no longer need it for this use case.

enter image description here


Initially we stored the unicode text in the "Link Description" but it appears that sometime after Sitecore 8.2.7/SXA 1.7.0 the text is html encoded. This meant that our previous approach using a VariantField to render the Link field would no longer work.

enter image description here

enter image description here

I solved this problem by extending a link tool we built (initially for NVelocity) for Scriban. A member of the community shows how to do the migration here.

Here you can see several methods exposed to help build the various parts of the link.

<div class="field-link">
    {{ $linkUrl = sc_linkTool.get_field_link_url i_item "Link" }}
    {{ $title = sc_linkTool.get_field_link_title i_item "Link" }}
    {{ $target = sc_linkTool.get_field_link_target i_item "Link" }}
    {{ $class = sc_linkTool.get_field_link_class i_item "Link" }}
    <a href="{{ $linkUrl }}" rel="noopener noreferrer" title="{{ $title }}" target="{{ $target }}"><i class="{{ $class }}"></i></a>
</div>

Not yet complete...

In the middle of converting to the new way

The "Link Description" is blank because I no longer need it for this use case.

enter image description here


Initially we stored the unicode text in the "Link Description" but it appears that sometime after Sitecore 8.2.7/SXA 1.7.0 the text is html encoded. This meant that our previous approach using a VariantField to render the Link field would no longer work.

enter image description here

enter image description here

Source Link
Michael West
  • 18.6k
  • 2
  • 42
  • 105

I solved this problem by extending a link tool we built (initially for NVelocity) for Scriban. A member of the community shows how to do the migration here.

Here you can see several methods exposed to help build the various parts of the link.

<div class="field-link">
    {{ $linkUrl =  sc_linkTool.get_field_link_url i_item "Link" }}
    {{ $title = sc_linkTool.get_field_link_title i_item "Link" }}
    {{ $target = sc_linkTool.get_field_link_target i_item "Link" }}
    {{ $class = sc_linkTool.get_field_link_class i_item "Link" }}
    <a href="{{ $linkUrl }}" rel="noopener noreferrer" title="{{ $title }}" target="{{ $target }}"><i class="{{ $class }}"></i></a>
</div>

Not yet complete...

In the middle of converting to the new way

The "Link Description" is blank because I no longer need it for this use case.

enter image description here


Initially we stored the unicode text in the "Link Description" but it appears that sometime after Sitecore 8.2.7/SXA 1.7.0 the text is html encoded. This meant that our previous approach using a VariantField to render the Link field would no longer work.

enter image description here

enter image description here