Home > Blockchain >  Multiple links in a tag liferay
Multiple links in a tag liferay

Time:06-05

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?

CodePudding user response:

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>
  • Related