Pog
Pog

Reputation: 13

Multiple links in a tag liferay

in the database I have links, which are a property of an entity, saved on a string, separated only by a comma. Example: "www.test.com, www.test.com, www.test.com".

I can see them with this code but they are not clickable links <liferay-ui:search-container-column-text name="Links" orderable="<%=false%>" value="<%=entity.getLinks() %>"/>

Can I display them to be clickable in a <liferay-ui: search-container-column-text tag?

Upvotes: 0

Views: 57

Answers (1)

Daniele Baggio
Daniele Baggio

Reputation: 2257

Try somethings like that:

 <liferay-ui:search-container-column-text name="Links" orderable="<%=false%>">
    <%
        String[] links = StringUtils.split(entity.getLinks());
    
        for (String link : links) {
    %>
        <a href="<%= link %>"><%= link %></a>
    <%
        }
    %>
    </liferay-ui:search-container-column-text>

Upvotes: 1

Related Questions