Foren

velocity code in articles

thumbnail
Jason Roscoe, geändert vor 13 Jahren.

velocity code in articles

Junior Member Beiträge: 84 Beitrittsdatum: 23.10.08 Neueste Beiträge
We are writing a portlet that retrieves articles for a specific category type, and then displaying them on a page. We can get the articles fine, but we have an issue with articles where the template they are using is performing a "replace" using velocity. Here is what the article template looks like:

<a href="$image-link.getData().replace(" http: content.server.com",$request.attributes.contentservername).replace("http: www.server.com",$request.attributes.servername)" #if ($image-link-window.getdata()="=" 'new') target="_blank" #end>
     <img src="$image.getData()" alt="$image-alt-text.getData()">
</a>

When we try to retrieve this content and display it, we get the below exception:

13:37:54,019 ERROR [velocity] Method replace threw exception for reference $image-link in template com.liferay.portlet.journal.util.JournalVmUtil at  [1,10]

Any suggestions on how to get around this?

Thanks!!