Skip to content

Instantly share code, notes, and snippets.

@jverweijL
Last active September 3, 2019 07:41
Show Gist options
  • Select an option

  • Save jverweijL/09478daadfc9c388189532a0d9cb5078 to your computer and use it in GitHub Desktop.

Select an option

Save jverweijL/09478daadfc9c388189532a0d9cb5078 to your computer and use it in GitHub Desktop.
{
"availableLanguageIds": [
"en_US"
],
"defaultLanguageId": "en_US",
"fields": [
{
"label": {
"en_US": "Url"
},
"predefinedValue": {
"en_US": ""
},
"style": {
"en_US": ""
},
"tip": {
"en_US": ""
},
"dataType": "string",
"indexType": "keyword",
"localizable": false,
"name": "Url",
"readOnly": false,
"repeatable": false,
"required": false,
"showLabel": true,
"type": "text"
},
{
"label": {
"en_US": "Remark"
},
"predefinedValue": {
"en_US": ""
},
"style": {
"en_US": ""
},
"tip": {
"en_US": ""
},
"dataType": "string",
"indexType": "keyword",
"localizable": true,
"name": "Remark",
"readOnly": false,
"repeatable": false,
"required": false,
"showLabel": true,
"type": "text"
}
]
}
<#assign VocabularyService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService") />
<#assign Vocabulary = VocabularyService.getAssetVocabulary(34506) />
<#assign AssetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") />
<#assign assetEntryQuery = objectUtil("com.liferay.asset.kernel.service.persistence.AssetEntryQuery") />
<#assign AssetEntryService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryService") />
<div class="container bookmarks">
<div class="row">
<#list Vocabulary.getCategories() as rootcat>
<#if rootcat.isRootCategory()>
<#--${rootcat.getName()}-->
<div class="col-sm">
<#list AssetCategoryLocalService.getChildCategories(rootcat.getCategoryId()) as category>
<h3>${category.getName()}</h3>
<#assign categories = [category.getCategoryId()] />
<#assign assignedCategoryIds=assetEntryQuery.setAnyCategoryIds(categories)/>
<#assign entries = AssetEntryService.getEntries(assetEntryQuery) />
<#list entries as curEntry>
<#assign renderer = curEntry.getAssetRenderer() />
<#assign journalArticle = renderer.getArticle() />
<#-- MODIFY THE ddmTemplateKey FOR YOUR SYSTEM -->
<@liferay_journal["journal-article"]
articleId=journalArticle.getArticleId()
ddmTemplateKey="34576"
groupId=journalArticle.getGroupId() />
</#list>
</#list>
</div>
</#if>
</#list>
</div>
</div>
<style>
.container .bookmarks .row div h3:first-child {
margin-top: 0px;
}
.container .bookmarks .row div h3 {
margin-top: 30px;
}
</style>
<a href="${Url.getData()}" title="${Remark.getData()}" alt="${Remark.getData()}">${.vars['reserved-article-title'].data}</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment