News (all-default, just selected list)

[% var collection_helper = data.lastLoopableCollection; %] [% if(collection_helper && collection_helper.length){ %] [% collection_helper.forEach(function( loopedItem, index ){ %] [% var tmpSearchableString = ''; %] [% var tmpVal = ''; %] [% var tmpCollectSearchData = new Array(); %] [% tmpSearchableString = "{"+ tmpCollectSearchData.join(",") +"}"; %]
[% var postUrl = get('loopedItem.data.url','',{'loopedItem':loopedItem}) %] [% postUrl = '/news/detail/?slug='+get('loopedItem.data.slug','',{'loopedItem':loopedItem}); %] [% if(get('loopedItem.data.teaser_url','',{'loopedItem':loopedItem})){ %] [% } %]

[%= get('loopedItem.data.author','n/a',{'loopedItem':loopedItem}) %]

[% if(get('loopedItem.data.release_date',null,{'loopedItem':loopedItem})){ %]

[%= moment(get('loopedItem.data.release_date','',{'loopedItem':loopedItem})).format('DD.MM.YYYY') %]

[% } %]
[% if(get('loopedItem.data.content','',{'loopedItem':loopedItem}).length){ %]

Words: [%= get('loopedItem.data.content','',{'loopedItem':loopedItem}).split(' ').length; %]

[% } %] [% if(get('loopedItem.data.content','',{'loopedItem':loopedItem}).length){ %]

Reading time: [%= Math.ceil(get('loopedItem.data.content','',{'loopedItem':loopedItem}).split(' ').length/150); %] minutes

[% } %]

[%= get('loopedItem.data.introduction','',{'loopedItem':loopedItem}) %]

[% }); %] [% } %]

NEWS

[% var collection_helper = data.news; %] [% if(collection_helper && collection_helper.length){ %] [% collection_helper.forEach(function( loopedItem, index ){ %] [% const article = loopedItem %] [% if(article.data.is_active) { } else { return; } %] [% var tmpSearchableString = ''; %] [% var tmpVal = ''; %] [% var tmpCollectSearchData = new Array(); %] [% tmpVal = get('loopedItem.data.title', null, {loopedItem}); if (tmpVal) { tmpVal = tmpVal.replace(/"/g, ''); } tmpCollectSearchData.push('"title":"'+tmpVal+'"'); %] [% tmpVal = get('loopedItem.data.title', null, {loopedItem}); if (tmpVal) { tmpVal = tmpVal.replace(/"/g, ''); } if ("text"==="date") { if (!tmpVal || tmpVal==="null") { tmpVal = "0"; } else { if (!isNaN(new Date(tmpVal).valueOf())) { tmpVal = new Date(tmpVal).valueOf(); } else { var parts = tmpVal.match(/(\d+)/g); if (parts && parts.length===3) { tmpVal = new Date(parts[2], parts[1]-1, parts[0]).valueOf(); } } } } tmpCollectSearchData.push('"title":"'+tmpVal+'"'); %] [% tmpVal = get('loopedItem.data.release_date', null, {loopedItem}); if (tmpVal) { tmpVal = tmpVal.replace(/"/g, ''); } if ("date"==="date") { if (!tmpVal || tmpVal==="null") { tmpVal = "0"; } else { if (!isNaN(new Date(tmpVal).valueOf())) { tmpVal = new Date(tmpVal).valueOf(); } else { var parts = tmpVal.match(/(\d+)/g); if (parts && parts.length===3) { tmpVal = new Date(parts[2], parts[1]-1, parts[0]).valueOf(); } } } } tmpCollectSearchData.push('"release_date":"'+tmpVal+'"'); %] [% tmpSearchableString = "{"+ tmpCollectSearchData.join(",") +"}"; %]

[%=article.data.author%] 

[%=moment(article.data.release_date).format('DD.MM.YYYY')%]

Worte: [%=article.data.content.split(' ').length;%], Lesedauer: [%=Math.ceil(article.data.content.split(' ').length/150);%] Minuten

[%=article.data.introduction%] 

[% }); %] [% } %]