2 Posts
2 years ago

I have a project where I need to construct an HTML override for a List View using a Link element. Eg. (Line 2)

<div class="banner-container">
  <a href="/$cck->getLink('product_link')" class="grad-hover banner-base" target="_blank">
    <img src="/$cck->getValue('product_thumbnail')" class="img-fluid" />
    <div class="banner-text">
      <h4 class="text-white">$cck->getValue('art_title')</h4>

But I want the URL Target to be from the setting in the database.

The Link element has been setup to record the URL as well as the Target.

In the Typographies HTML $cck->getLink('product_link') gives me URL component. 

$cck->getValue('product_link') gives me a JSON string with elements for "Link" and "Target". Eg:


But how can I isolate the Target element separately so I can construct my HTML override?

I've tried the following:


But these aren't allowable methods.

Hope someone can help. :)

Get a VIP membership