An error occurred while processing the template.
Can't convert this string to number: "www.kas.de" The blamed expression: ==> urlparts[2]?number [in template "252001#252047#WCD_DEBATTENBLOG_STATISCHDETAIL_CONTENT" at line 80, column 104] ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign linkToDMT = FrontendService.m... [in template "252001#252047#WCD_DEBATTENBLOG_STATISCHDETAIL_CONTENT" in macro "mediaElement" at line 80, column 15] - Reached through: @mediaElement url [in template "252001#252047#WCD_DEBATTENBLOG_STATISCHDETAIL_CONTENT" in macro "contentMedia" at line 97, column 13] - Reached through: @contentMedia cur_contenttext [in template "252001#252047#WCD_DEBATTENBLOG_STATISCHDETAIL_CONTENT" at line 121, column 23] ----
1<#-- bezieht sich auf WCS Statischer Inhalt -->
2<#assign AssetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService") />
3<#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") />
4<#assign articleId = .vars['reserved-article-id'].data />
5<#assign articleTitle = .vars['reserved-article-title'].data />
6<#assign version = .vars['reserved-article-version'].data?number />
7<#assign article = JournalArticleLocalService.fetchArticle( articleGroupId, articleId , version ) />
8
9<#if requestMap??>
10 <#assign
11 renderUrl = requestMap['render-url']
12 control_panel = renderUrl?contains('control_panel')
13 >
14</#if>
15
16<#if control_panel?? && control_panel>
17 <#if FrontendService.user.isPrivilegedUser(permissionChecker.getUser())>
18 <pre>
19 articleId = ${.vars['reserved-article-id'].data}
20 version = ${.vars['reserved-article-version'].data}
21 groupId = ${articleGroupId}
22 structurekey = ${article.getDDMStructureKey()}
23 </pre>
24 <pre style="white-space: pre-wrap;">
25 ${FrontendService.json.transformToJson( article, true )}
26 </pre>
27 </#if>
28<#else>
29 <#include "${fullTemplatesPath}/macros/page-modules/PMPageContent.ftl" />
30
31 <#-- functions -->
32 <#function getJournalArticle dataObj >
33 <#local journalArticle = "" >
34
35 <#attempt>
36 <#local data = dataObj.getData()?eval >
37 <#local classPK = data.classPK >
38 <#local className = data.className >
39 <#local entry = AssetEntryLocalService.getEntry(className, classPK?number)! >
40
41 <#if entry??>
42 <#local assetRenderer = entry.getAssetRenderer() />
43 <#local journalArticle = (assetRenderer.getArticle())! />
44 </#if>
45 <#recover>
46 <#-- catch block -->
47 </#attempt>
48
49 <#return journalArticle >
50
51 </#function>
52
53 <#function getSaxReaderDocument dataObj >
54 <#local document = "" >
55
56 <#local journalArticle = getJournalArticle(dataObj) >
57 <#if journalArticle?has_content>
58 <#local document = (saxReaderUtil.read(journalArticle.getContentByLocale(locale.toString())))!"" />
59 </#if>
60
61 <#return document >
62
63 </#function>
64
65 <#function hasMedia contenttext >
66 <#return (contenttext.contentmediumDMTKASDEMEDIUM.getData())?has_content >
67 </#function>
68
69 <#function hasMediaGallery contenttext >
70 <#return (contenttext.contentbilderstreckeWCSKASDEBILDERSTRECKE.getData())?has_content >
71 </#function>
72
73 <#-- BEGINN Content macros
74 ------------------------------------------------------------------------------------------------------------------------>
75
76 <#macro mediaElement url >
77 <#if url?contains(".jpg") || url?contains(".jpeg") || url?contains(".png") || url?contains(".gif")>
78 <#assign urlparts = url?split("/") />
79 <#if (urlparts?size > 5) >
80 <#assign linkToDMT = FrontendService.media.getImageURLForAMConfiguration('hd-resolution',urlparts[2]?number, urlparts[5]?keep_before("?") ) />
81 </#if>
82 <#if linkToDMT?has_content>
83 <img src="${linkToDMT}" />
84 </#if>
85 <#elseif url?contains(".mp4") || url?contains(".ogg") >
86 <video width="100%" height="100%" controls>
87 <source src="${url}" >
88 Your browser does not support the video tag.
89 </video>
90 </#if>
91 </#macro>
92
93 <#macro contentMedia contenttext >
94 <#local url = contenttext.contentmediumDMTKASDEMEDIUM.getData()>
95
96 <div>
97 <@mediaElement url />
98 <#if (contenttext.contentbildunterschrift)?has_content>
99 <span>${contenttext.contentbildunterschrift.getData()}<span>
100 </#if>
101 </div>
102 </#macro>
103
104 <#macro contentMediaGallery contenttext >
105 <#local data = contenttext.contentbilderstreckeWCSKASDEBILDERSTRECKE.getData()>
106 ${data}
107 </#macro>
108
109 <#-- END Content macros
110 ------------------------------------------------------------------------------------------------------------------------>
111
112 <div class="o-page-module c-page-main c-page-main--detail c-page-main--statischdetail">
113 <div class="c-page-main__text o-richtext">
114 <p>
115 <#-- Contentblock -->
116 <#if contenttext.getSiblings()?has_content>
117 <#assign iFrameId = 0 >
118 <#list contenttext.getSiblings() as cur_contenttext>
119
120 <#if hasMedia(cur_contenttext) >
121 <@contentMedia cur_contenttext />
122 </#if>
123
124 <#if hasMediaGallery(cur_contenttext) >
125 <@contentMediaGallery cur_contenttext />
126 </#if>
127
128 <#if hasIFrame(cur_contenttext) >
129 <#assign iFrameId = iFrameId + 1 >
130 <@contentIFrame cur_contenttext iFrameId "blog"/>
131 </#if>
132
133 <@contentText cur_contenttext />
134
135 </#list>
136 </#if>
137 </p>
138 </div>
139 </div>
140</#if>