Reputation: 2683
How can you select specific dynamic elements to be displayed from the abstract display? For example if I have the following in my template
<td>Sample Text</td>
<td>$sample-text.data</td>
<td>Display Text</td>
<td>$display-text.data</td>
How can I make the abstract display only show the display-text and not both?
Sorry let me try and clear this up. The asset publisher has web content (used to be journal). The web content has different ways to display the articles. They have table, title list, abstract, and full content. If I use the abstract display and the user has imputed an abstract than the title and abstract are shown. If no abstract is imputed than the title and summary is shown. The summary consist of the dynamic elements. My question really boils down to how can I have the abstract view only show select elements from the summary. Summary is obtained by
String summary = StringUtil.shorten(assetRenderer.getSummary(locale), abstractLength);
which is located in the abstracts.jsp.
Upvotes: 2
Views: 1488
Reputation: 3465
Your question is confusing so I'll cover a couple of things.
Liferay's Web Content Template supports a couple of templating languages and of those I personally prefer Velocity Macros (VM).
If you do not want to show $sample-text.data simply delete the line of code that displays it! Specifically, remove this line:
<td>$sample-text.data</td>
If you're trying to control the display based on some condition, VM does support conditionals. You can implement them simply like so:
#if ($sample-text.data != null)
<td>$sample-text.data</td>
#end
You can find the complete documentation on Velocity here: http://velocity.apache.org/engine/releases/velocity-1.5/user-guide.html
Upvotes: 1