%
/* Head */
(function(home, config, lang) {
var metaPrerenderStatusCodeMetaEl = document.querySelector('meta[name="prerender-status-code"]');
var metaDescriptionEl = document.querySelector('meta[name="description"]');
var metaOGTitleEl = document.querySelector('meta[property="og:title"]');
var metaOGImageEl = document.querySelector('meta[property="og:image"]');
var metaAppName = document.querySelector('meta[name="application-name"]');
var aprovBranding = {
'de': 'Autonome Provinz Bozen - S\u00fcdtirol',
'it': 'Provincia autonoma di Bolzano - Alto Adige',
'lld': 'Provinzia Autonoma de Bulsan - S\u00fcdtirol',
'en': 'Autonomous Province of Bolzano/Bozen - South Tyrol'
}[(/^(de|it|lld|en)$/.test(lang) ? lang : 'de')];
if (metaAppName) {
metaAppName.setAttribute("content", (home.metadata__meta_title || '').length ? home.metadata__meta_title : [(home.title || ''), (aprovBranding || '')].join(' | '));
}
var title = (home.metadata__meta_title || '').length ? home.metadata__meta_title : [(home.title || ''), (aprovBranding || '')].join(' | ');
document.title = title;
if (metaPrerenderStatusCodeMetaEl) {
metaPrerenderStatusCodeMetaEl.setAttribute("content", "200");
}
if (metaDescriptionEl) {
metaDescriptionEl.setAttribute("content", (home.metadata__meta_description || ''));
}
if (metaOGTitleEl) {
metaOGTitleEl.setAttribute("content", (home.metadata__og_title || title));
}
if (metaOGImageEl) {
metaOGImageEl.setAttribute("content", ((home.metadata__og_image || []).length ? home.metadata__og_image[0].url : ''));
}
(function(model, config, lang) {
var langid = config.langId && (config.langId[lang] || '').length ? config.langId[lang] : '00000000-0000-0000-0000-000000000000';
if ((config.projectId || '').length && (model.system_id || '').length) {
if ($('meta[name=pageID]').length) {
$('meta[name=pageID]').attr('content', model.system_id);
} else {
$('head').append('');
}
if ($('meta[name=languageID]').length) {
$('meta[name=languageID]').attr('content', langid);
} else {
$('head').append('');
}
if ($('meta[name=projectID]').length) {
$('meta[name=projectID]').attr('content', config.projectId);
} else {
$('head').append('');
}
}
})(home, config, (lang || 'de'));
})(home || {}, WebBaseAprovLV.config || {}, WebBaseAprovLV.lang);
/* Fixed Home Slider */
(function(slider_container, lang, Utils) {
if (slider_container.length > 0) {
var sliderClasses = ["lv_slider_full carousel slide carousel-fade"];
var sliderCaptionBackgroundType = (home.slider_caption_background_type || []).length ? home.slider_caption_background_type[0] : {};
var sliderType = (home.slider_type || []).length ? home.slider_type[0] : {};
var taxonomyLangIdx = {'de': 0, 'it': 1, 'lld': 2, 'en': 3}[(/^(de|it|lld|en)$/.test(lang) ? lang : 'de')];
sliderClasses.push((home.slider_caption_background_type || []).length ? home.slider_caption_background_type[0].codename : 'lv_slider_01');
%>
<% if (sliderType.codename!=="random") { %>
<%
slider_container.forEach(function(item, i) {
%><%
}); %>
<% } else {
var randomSlide = function(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
};
var randomSelectedSlide = randomSlide(0,slider_container.length);
} %>
<%
slider_container.forEach(function(slider, sliderIdx) {
var sliderLink = '';
var sliderBackgroundImg = '';
var sliderMoreButtonText = Utils.gettext("More");
var sliderOverlay = [
['opacity:', (slider.overlay_opacity || '0.0').toString(10).replace(/[^\.0-9]/igm, '')].join(''),
['background-color:', (slider.overlay_color || 'black').replace(/[^#A-Z0-9a-z]/igm, '')].join('')
];
var newsCategories = (slider.news_categories || []).map(function(category) {
var name = (category.name || '').split('|');
return name.length > taxonomyLangIdx ? name[taxonomyLangIdx] : category.name;
});
if ((slider.more_button_text || '').length) {
sliderMoreButtonText = slider.more_button_text;
}
var sliderImage = (slider.image || [{}])[0];
if ((slider.internal_link || '').length) {
sliderLink = Utils.linkTo(['', lang, (slider.internal_link[0].url || '')].join('/'));
} else if ((slider.external_link || '').length) {
sliderLink = slider.external_link;
}
if (sliderImage) {
sliderBackgroundImg = "background-image: url('" + (sliderImage.url || '') + "?h=580&fit=crop&fm=webp&lossless=0&q=75\');"
}
if (sliderType.codename!=="random") { %>
<% if ((slider.topic || "").length) { %>
<%= (slider.topic || '') %>
<% } else if ((slider.news_categories || "").length) { %>
<% slider.news_categories.forEach(function(item) {
var names = item.name.split('|');
%> <%= (names.length > taxonomyLangIdx ? names[taxonomyLangIdx] : item.name) %><%
}); %>
<% } %>
<%= (slider.short_title ? slider.short_title : (slider.title || '')) %>
<% if (!!(slider.subtitle || '').length && slider.system_type!="news") { %>
<%= (slider.short_title ? slider.short_title : (slider.subtitle || '')) %>
<% } %>
<% if ((sliderLink || '').length) { %>
<%= sliderMoreButtonText %>
<% } %>
<% } else {
if (sliderIdx===randomSelectedSlide) { %>
<% if ((slider.topic || "").length) { %>
<%= (slider.topic || '') %>
<% } else if ((slider.news_categories || "").length) { %>
<% slider.news_categories.forEach(function(item) {
var names = item.name.split('|');
%> <%= (names.length > taxonomyLangIdx ? names[taxonomyLangIdx] : item.name) %><%
}); %>
<% } %>
<%= (slider.short_title ? slider.short_title : (slider.title || '')) %>
<% if (!!(slider.subtitle || '').length && slider.system_type!="news") { %>
<%= (slider.subtitle || '') %>
<% } %>
<% if ((sliderLink || '').length) { %>
<%= sliderMoreButtonText %>
<% } %>
<% }
} %>
<%
});
%>
<% if ((slider_container || []).length > 1 && sliderType.codename!=="random") { %>
<%= Utils.gettext("Previous") %><%= Utils.gettext("Next") %><% } %>
<%
}
})((home || {}).slider_container || [], WebBaseAprovLV.lang, WebBaseAprovLV.Utils);
%>
<% if (home.container) {
home.container.forEach(function(container, containerIndex) {
%>
<% // Slider Container: [Slider Item]
if (container.system_type === "slider_container") {
(function(container, lang, Utils) {
if ((container.container || []).length) {
var containerClasses = ["content_section_lg"];
var sliderClasses = ["lv_slider_full lv_slider_01 carousel slide carousel-fade"];
var sliderUniqueID = (container.system_id || '').replace(/[\s\-]/g, '');
var taxonomyLangIdx = {'de': 0, 'it': 1, 'lld': 2, 'en': 3}[(/^(de|it|lld|en)$/.test(lang) ? lang : 'de')];
sliderClasses.push((container.caption_background_type || []).length ? container.caption_background_type[0].codename : 'lv_slider_01');
if ((container.sectionbackground__background_type || []).length) {
containerClasses.push(container.sectionbackground__background_type[0].codename || '');
}
if (sliderUniqueID) {
containerClasses.push('lv_slider_' + sliderUniqueID);
sliderUniqueID = 'lv_sliderid_' + sliderUniqueID;
}
%>
<% if ((container.title || "").length) {
%>
<%= (container.title || "") %>
<%
} %>
<% if (container.container.length > 1) { %>
<% container.container.forEach(function(item, i) { %>
<% }); %>
<% } %>
<%
(container.container || []).forEach(function(slider, sliderIdx) {
var sliderLink = '';
var sliderImg = '';
var sliderMoreButtonText = Utils.gettext("More");
var sliderOverlay = [
['opacity:', (slider.overlay_opacity || '0.0').toString(10).replace(/[^\.0-9]/igm, '')].join(''),
['background-color:', (slider.overlay_color || 'black').replace(/[^#A-Z0-9a-z]/igm, '')].join('')
];
if ((slider.more_button_text || '').length) {
sliderMoreButtonText = slider.more_button_text;
}
var sliderNewsImage = (slider.slider_image || []).length ? slider.slider_image[0] : '';
var sliderImage = (slider.image || []).length ? slider.image[0] : sliderNewsImage;
var sliderImageCustomRendition = "";
if (sliderImage.renditions) {
sliderImageCustomRendition = sliderImage.renditions.default;
}
var sliderTitle = (slider.short_title || []).length ? slider.short_title : slider.title;
if ((slider.internal_link || '').length) {
sliderLink = Utils.linkTo(['', lang, (slider.internal_link[0].url || '')].join('/'));
} else if ((slider.external_link || '').length) {
sliderLink = slider.external_link;
}
if ((sliderLink || '').length<=0) {
if ((slider.url || '').length) {
sliderLink = ['/', lang, '/news/', (slider.url || '')].join('');
}
}
var sliderParam = "?w=830&h=550&fit=crop&fm=webp&lossless=0&q=75"
if (sliderImageCustomRendition) {
var rndition = sliderImageCustomRendition.query;
if ((rndition.toLowerCase().indexOf('w=830') !== -1) && (rndition.toLowerCase().indexOf('h=550') !== -1)) {
sliderParam = "?" + rndition;
}
}
sliderImg = (sliderImage.url || '') + sliderParam %>
<% if ((slider.topic || "").length) { %>
<%= (slider.topic || '') %>
<% } else if ((slider.news_categories || []).length) { %>
<% slider.news_categories.forEach(function(item) {
var names = item.name.split('|');
%> <%= (names.length > taxonomyLangIdx ? names[taxonomyLangIdx] : item.name) %><%
}); %>
<% } %>
<% if ((container.title || "").length) { %>
<%= (sliderTitle || '') %>
<% } else { %>
<%= (sliderTitle || '') %>
<% } %>
<% if (!!(slider.subtitle || '').length && slider.system_type!="news") { %>
<%= (slider.subtitle || '') %>
<% } %>
<% if ((sliderLink || '').length) { %>
<%= sliderMoreButtonText %>
<% } %>
<%
});
%>
<%
if ((container.container || []).length > 1) {
%>
<%= Utils.gettext("Previous") %><%= Utils.gettext("Next") %><%
} %>
<%
}
})(container, WebBaseAprovLV.lang, WebBaseAprovLV.Utils);
} %>
<% // Text Image Container Item
if (container.system_type === "image_and_text_section") {
(function(container) {
var imageExp = (container.imageposition__image_expansion || []).length ? container.imageposition__image_expansion[0] : {};
var imagePos = (container.imageposition__image_position || []).length ? container.imageposition__image_position[0] : {};
var imageHeight = (container.imageposition__image_height || []).length ? container.imageposition__image_height[0] : {};
var textImageSectionBackgroundClass = (container.sectionbackground__background_type || []).length ? container.sectionbackground__background_type[0].codename : '';
var uniqueTextImageSectionClass = container.system_id;
uniqueTextImageSectionClass = uniqueTextImageSectionClass.substring(1, 8);
%> <%
if ((container.title || "").length) {
%>
<%= (container.title || "") %>
<%
}
(container.image || []).forEach(function(image) {
var imgParams = ['?w=1170&fm=webp&lossless=0&q=75'];
var figClassArr = [imageExp.codename ? imageExp.codename : 'full', imagePos.codename ? imagePos.codename : 'sx'];
var imgTitle = (image.description || '').replace(/\u0022/g, '');
if (!imageHeight.codename || /fixed/i.test(imageHeight.codename || '')) {
imgParams.push('h=450', 'fit=crop');
}
if (/(half|single)/i.test(imageExp.codename || '')) {
imgParams = ['?w=562&fm=webp&lossless=0&q=75'];
}
%>
![<%= imgTitle %> <%= imgTitle %>](<%- image.url + imgParams.join('&') %>)
<%
});
if (container.description.length > 11) {
%>
<%- (container.description || "") %>
<%
} %>
<%
})(container);
} %>
<% // News Container: [News Item]
if (container.system_type === "news_container") {
(function(Model, container, lang, Utils) {
var newsItems = container.container || [];
var taxonomyLangIdx = {'de': 0, 'it': 1, 'lld': 2, 'en': 3}[(/^(de|it|lld|en)$/.test(lang) ? lang : 'de')];
var collection = Model.collections[container.system_codename || ''];
var containterClasses = ["content_section"];
var showThumbnail = (container.show_thumbnail || []).length ? container.show_thumbnail[0].codename : '';
if (collection) {
newsItems = newsItems.concat(collection.viewmodel || []);
}
if ((container.sectionbackground__background_type || []).length) {
containterClasses.push(container.sectionbackground__background_type[0].codename || '');
}
if (container.system_id) {
containterClasses.push("lv_news_" + container.system_id.replace(/[\s\-]/g, ''));
}
%>
<%= container.title %>
<% // Quelix Dynamic News Search
if ((typeof collection != "undefined") && (newsItems.length === 0)) { %>
<% if(typeof collection.raw.GSP != "undefined"){
if(collection.raw.GSP.RES){
if(collection.raw.GSP.RES.R){
$.each(collection.raw.GSP.RES.R, function (index,item) {
%>
<% if (item.MT.main_image && !/no/i.test(showThumbnail)) { %>
<% $.each(item.MT.main_image, function (aindex,aitem) { %>
<% }); %>
<% } %>
<% (item.MT.news_categories || []).forEach(function(cate) {
var names = cate.split('|');
%> <%= (names.length > taxonomyLangIdx ? names[taxonomyLangIdx] : cate) %><%
});
%>
<%= item.MT.subtitle %>
<% if (item.MT.date) { %>
<%= Utils.formatDateTime(item.MT.date[0], 'withtime') %>
<% } %>
<%
});
}
}
} else { %>
<%= Utils.gettext('No news available!') %>
<% } %>
<% } else { %>
<%
if (newsItems.length === 0) {
%>
<%= Utils.gettext('No news available!') %>
<%
}
var detailPath = {
'de': 'https://news.provinz.bz.it',
'it': 'https://news.provincia.bz.it',
'lld': 'https://news.provinzia.bz.it',
'en': 'https://news.provinz.bz.it'
};
newsItems.forEach(function(article) {
var thumbImage = (article.main_image || []).length ? article.main_image[0] : {};
%>
<%
if (thumbImage.url && !/no/i.test(showThumbnail)) {
%>
<%
} %>
<%
if (article.news_categories) {
%>
<%
article.news_categories.forEach(function(item) {
var names = item.name.split('|');
%> <%= (names.length > taxonomyLangIdx ? names[taxonomyLangIdx] : item.name) %><%
});
%>
<%
}
if ((container.title || "").length) { %>
<% } else { %>
<% }
if (article.subtitle) {
%>
<%= article.subtitle %>
<%
} %>
<%= (article.date ? Utils.formatDateTime(article.date, 'withtime') : '') %>
<%
});
%>
<% } %>
<%
})({
main: main || {},
home: home || {},
collections: collections || {}
}, container, WebBaseAprovLV.lang, WebBaseAprovLV.Utils);
} %>
<% // News-Ticker Container: [News Item]
if (container.system_type === "newsticker_container") {
(function(Model, container, lang, Utils) {
var newsItems = container.container || [];
var collection = Model.collections[container.system_codename || ''];
var containterClasses = ["content_section"];
if (collection) {
newsItems = newsItems.concat(collection.viewmodel || []);
}
if ((container.sectionbackground__background_type || []).length) {
containterClasses.push(container.sectionbackground__background_type[0].codename || '');
}
if (container.system_id) {
containterClasses.push("lv_newsticker_" + container.system_id.replace(/[\s\-]/g, ''));
}
if (newsItems.length) {
%>
<%
}
})({
main: main || {},
home: home || {},
collections: collections || {}
}, container, WebBaseAprovLV.lang, WebBaseAprovLV.Utils);
} %>
<% // Appointments Container: [Appointment Item]
if (container.system_type === "appointment_container") {
(function(Model, container, lang, Utils) {
var appointmentItems = container.container || [];
var collection = Model.collections[container.system_codename || ''];
var containterClasses = ["content_section"];
var detailPath = {
'de': 'veranstaltungen',
'it': 'manifestazioni',
'lld': 'manifestaziuns',
'en': 'events'
};
var taxonomyLangIdx = {'de': 0, 'it': 1, 'lld': 2, 'en': 3}[(/^(de|it|lld|en)$/.test(lang) ? lang : 'de')];
if (collection) {
appointmentItems = appointmentItems.concat(collection.viewmodel || []);
}
if ((container.sectionbackground__background_type || []).length) {
containterClasses.push(container.sectionbackground__background_type[0].codename || '');
}
if (container.system_id) {
containterClasses.push("lv_events_" + container.system_id.replace(/[\s\-]/g, ''));
}
%>
<%= (container.title || '') %>
<%
if ((container.subtitle || '').length) {
%>
<%= container.subtitle %>
<%
} %>
<% if (appointmentItems.length === 0) {
%>
<%= Utils.gettext('No dates available!') %>
<%
} else {
appointmentItems.forEach(function(appointment) {
%>
<%
});
} %>
<%
})({
main: main || {},
home: home || {},
collections: collections || {}
}, container, WebBaseAprovLV.lang, WebBaseAprovLV.Utils);
} %>
<% // Text and News Container Item: [News Item]
if (container.system_type === "text_and_news_item") {
(function(container, news, lang, Utils) {
var linkHref;
var titleNewsAttr = Utils.gettext('Continue to page') + ': \u00bbNews\u00bb';
var taxonomyLangIdx = {'de': 0, 'it': 1, 'lld': 2, 'en': 3}[(/^(de|it|lld|en)$/.test(lang) ? lang : 'de')];
%>
<%= (container.title || '') %>
<%
if ((container.description || '').length>11) {
%>
<%- container.description %>
<%
}
if ((container.external_link || '').length>0 || (container.internal_link || []).length>0) {
%>
<%
(container.internal_link || []).forEach(function(linkitem) {
var linkPage = Utils.linkTo(['', lang, (linkitem.url || '')].join('/'));
var titleAttr = Utils.gettext('Continue to page') + ': »'+ (linkitem.title || '').replace(/\u0022/g,'') +'»';
%>
<%= Utils.gettext('More') %> <%
});
if ((container.external_link || '').length>0) {
linkHref = container.external_link || '';
%>
<%= Utils.gettext('More') %> <%
}
%>
<%
} %>
News
<%
if (news.length) {
news.filter(function(article, idx) {
return idx === 0;
}).forEach(function(article) {
%>
<%
});
%>
<%
} else {
%>
<%= Utils.gettext('No news available!') %>
<%
} %>
<%
})(container, news, WebBaseAprovLV.lang, WebBaseAprovLV.Utils);
} %>
<% // Alert Section
if (container.system_type === "alert_section") {
(function(container, lang, Utils) {
var linkHref;
%>
<%= (container.title || '') %>
<%
if ((container.description || '').length>11) {
%>
<%- container.description %>
<%
}
var linklabeltext = '';
if ((container.link_text || '').length>0) {
linklabeltext = container.link_text;
} else {
linklabeltext = Utils.gettext('More');
}
if ((container.external_link || '').length>0 || (container.internal_link || []).length>0) {
(container.internal_link || []).forEach(function(linkitem) {
var linkPage = Utils.linkTo(['', lang, (linkitem.url || '')].join('/'));
var titleAttr = Utils.gettext('Continue to page') + ': \u00bb'+ (linkitem.title || '').replace(/\u0022/g,'') +'\u00bb';
%>
<%= linklabeltext %> <%
});
if ((container.external_link || '').length>0) {
linkHref = container.external_link || '';
%>
<%= linklabeltext %> <%
}
} %>
<%
})(container, WebBaseAprovLV.lang, WebBaseAprovLV.Utils);
} %>
<% // Highlight Section
if (container.system_type === "hilite_section") {
(function(container, lang, Utils) {
var linkHref;
var highlightSectionBackgroundClass = (container.sectionbackground__background_type || []).length ? container.sectionbackground__background_type[0].codename : '';
var highlightSectionTypeClass = (container.section_classification || []).length ? container.section_classification[0].codename : 'hero_text';
var uniqueHighlightSectionClass = container.system_id;
uniqueHighlightSectionClass = uniqueHighlightSectionClass.substring(1, 8);
%>
<%= (container.title || '') %>
<%
if ((container.description || '').length>11) {
%>
<%- container.description %>
<%
}
var linklabeltext = '';
if ((container.link_text || '').length>0) {
linklabeltext = container.link_text;
} else {
linklabeltext = Utils.gettext('More');
}
if ((container.external_link || '').length>0 || (container.internal_link || []).length>0) {
(container.internal_link || []).forEach(function(linkitem) {
var linkPage = Utils.linkTo(['', lang, (linkitem.url || '')].join('/'));
var titleAttr = Utils.gettext('Continue to page') + ': \u00bb'+ (linkitem.title || '').replace(/\u0022/g,'') +'\u00bb';
%>
<%= linklabeltext %> <%
});
if ((container.external_link || '').length>0) {
linkHref = container.external_link || '';
%>
<%= linklabeltext %> <%
}
} %>
<%
})(container, WebBaseAprovLV.lang, WebBaseAprovLV.Utils);
} %>
<% // Introduction Section
if (container.system_type === "introduction_section") {
(function (container, lang, Utils, containerIndex) {
var introImage = '';
var introLink = '';
var introClass = '';
var videoTitle;
if (typeof container.internal_link != "undefined") {
introLink = '/' + WebBaseAprovLV.lang + '/' + container.internal_link[0].url;
} else if (typeof container.external_link != "undefined") {
introLink = container.external_link;
}
if (containerIndex % 2 === 0) {
introClass = '';
} else {
introClass = 'flex-row-reverse';
}
%>
<% (container.image || []).forEach(function(img) {
var desc = (img.description || "").replace(/[\x00-\x1f\x3c\x3e"]/igm, "");
%>
![<%= desc %>](<%= (img.url || )
?w=562" title="<%= desc %>">
<%
}); %>
<% if (typeof container.youtube__youtube_video != "undefined") { %>
<% if (container.youtube__youtube_video != null) { %>
<% var newsvideoObj = JSON.parse(container.youtube__youtube_video); %>
<% if (newsvideoObj != null) {
videoTitle = (newsvideoObj.title || '').replace(/\u0027/g, "'").replace(/[\u0022\r\n]/g, "\u0020"); %>
<% } %>
<% } %>
<% } %>
<%= container.title %>
<% if ((container.description || "").length>11) { %>
<%- container.description %>
<% }
if (introLink.length) {
%>
<%
} %>
<%
})(container || {}, WebBaseAprovLV.lang, WebBaseAprovLV.Utils, containerIndex);
} %>
<% // YouTube Video
if (container.system_type === "youtube_video_item") {
(function(container, containerIndex, lang) {
var youtubeSectionBackgroundClass = (container.sectionbackground__background_type || []).length ? container.sectionbackground__background_type[0].codename : '';
var videoObj;
var videoTitle;
try {
videoObj = JSON.parse(container.youtube__youtube_video);
} catch(e) {
videoObj = {};
}
if (videoObj && videoObj.videoId) {
%><%
videoTitle = (videoObj.title || '').replace(/\u0027/g, "'").replace(/[\u0022\r\n]/g, "\u0020");
if ((container.title || "").length) {
%>
<%= (container.title || "") %>
<%
}
if ((container.description || "").length>11) {
%>
<%- container.description %>
<%
}
%>
<%
if (videoObj.short_description) {
%>
<%= videoObj.short_description %>
<%
} %>
<%
}
})(container, containerIndex, WebBaseAprovLV.lang);
} %>
<% // Banner Container: [Banner Item]
if (container.system_type === "banner_container") {
(function(container, lang, Utils) {
var bannerSectionBackgroundClass = (container.sectionbackground__background_type || []).length ? container.sectionbackground__background_type[0].codename : '';
var bannerColClass = (container.columns || []).length ? container.columns[0].codename : 'lv_col_2';
var uniqueBannerSectionClass = container.system_id;
uniqueBannerSectionClass = uniqueBannerSectionClass.substring(1, 8);
%>
<% if ((container.title || []).length>0) { %>
<%= container.title %>
<% } %>
<%
(container.container || []).forEach(function(banner) {
var linkUrl = '';
var imgUrl = (banner.image || []).length>0 ? (banner.image[0].url + '?w=568&h=150&fit=crop&fm=webp&lossless=0&q=75'): 'img/banner/banner.png';
var imgTitle = banner.title || '';
if ((banner.internal_link || []).length>0) {
linkUrl = Utils.linkTo(['', lang, (banner.internal_link[0].url || '')].join('/'));
}
if ((banner.external_link || '').length>0) {
imgTitle = '[external Link]: ' + imgTitle;
linkUrl = banner.external_link || '';
}
if ((linkUrl || '').length === 0) {
linkUrl = '#';
}
%>
<%
}); %>
<%
})(container, WebBaseAprovLV.lang, WebBaseAprovLV.Utils);
} %>
<% // Link Board Container: [Link Board Item]
if (container.system_type === "link_board_container") {
(function(container, lang, Utils) {
var linkboardSectionBackgroundClass = (container.sectionbackground__background_type || []).length ? container.sectionbackground__background_type[0].codename : '';
var uniquelinkboardSectionClass = container.system_id;
uniquelinkboardSectionClass = uniquelinkboardSectionClass.substring(1, 8);
%>
<% if ((container.title || []).length>0) { %>
<%= container.title %>
<% } %>
<%
(container.container || []).forEach(function(link_board_item) {
var linkboardlinkUrl = '';
var linkboardTitle = link_board_item.title || '';
if ((link_board_item.link_internal || []).length>0) {
linkboardlinkUrl = Utils.linkTo(['', lang, (link_board_item.link_internal[0].url || '')].join('/'));
}
if ((link_board_item.link_external || '').length>0) {
linkboardTitle = '[external Link]: ' + linkboardTitle;
linkboardlinkUrl = link_board_item.link_external || '';
}
if ((linkboardlinkUrl || '').length === 0) {
linkboardlinkUrl = '';
} %>
<% if ((linkboardlinkUrl || '').length>0) { %>
<% if (linkboardTitle.length>0) { %>
<%= link_board_item.title %>
<% } %>
<% } %>
<%
}); %>
<%
})(container, WebBaseAprovLV.lang, WebBaseAprovLV.Utils);
} %>
<% // Box Container: [Box Item]
if (container.system_type === "box_container") {
(function(container, lang, Utils) {
var boxSectionBackgroundClass = (container.sectionbackground__background_type || []).length ? container.sectionbackground__background_type[0].codename : '';
var boxColClass = (container.columns || []).length ? container.columns[0].codename : 'lv_col_2';
var boxTextAlignement = (container.box_text_alignment || []).length ? 'text-' + container.box_text_alignment[0].codename : '';
var uniqueBoxSectionClass = container.system_id;
uniqueBoxSectionClass = uniqueBoxSectionClass.substring(1, 8);
%>
<% if ((container.title || []).length>0) { %>
<%= container.title %>
<% } %>
<%
(container.container || []).forEach(function(box) {
var boxClass = (box.box_type || []).length ? box.box_type[0].codename : '';
var linkType = '';
if (box.link_type && Array.isArray(box.link_type)) {
box.link_type.forEach(function(link_type) {
linkType = (link_type.codename || '');
});
};
var boxlinkUrl = '';
var linkButtonText = (box.link_text || []).length>0 ? (box.link_text): Utils.gettext('More');
var imgUrl = (box.image || []).length>0 ? (box.image[0].url + '?w=562&h=300&fit=crop&fm=webp&lossless=0&q=75'): '';
var imgTitle = box.title || '';
if ((box.link_internal || []).length>0) {
boxlinkUrl = Utils.linkTo(['', lang, (box.link_internal[0].url || '')].join('/'));
}
if ((box.link_external || '').length>0) {
imgTitle = '[external Link]: ' + imgTitle;
boxlinkUrl = box.link_external || '';
}
if ((boxlinkUrl || '').length === 0) {
boxlinkUrl = '';
}
%>
<% if ((imgUrl || []).length>0) { %>
<% if ((boxlinkUrl || '').length>0) { %>
![<%= imgTitle.replace(/\u0022/g,'') %>](<%- imgUrl %>)
<% } else { %>
![<%= imgTitle.replace(/\u0022/g,'') %>](<%- imgUrl %>)
<% } %>
<% } %>
<% if ((box.title || []).length>0) { %>
<% if (/title/i.test(linkType) && ((boxlinkUrl || '').length>0)) { %><%= box.title %><% } else { %><%= box.title %><% } %>
<% } %>
<% if ((box.text || '').length > 11) { %>
<%- box.text %>
<% } %>
<% if (/button/i.test(linkType) && ((boxlinkUrl || '').length>0)) { %>
<%= linkButtonText %>
<% } %>
<%
}); %>
<%
})(container, WebBaseAprovLV.lang, WebBaseAprovLV.Utils);
} %>
<% // Downloads Group:
if (/downloads_group_section/i.test(container.system_type)) {
(function (container, lang, Utils) {
%><%
if ((container.title || "").length) {
%>
<%= (container.title || "") %>
<%
}
if (container.description.length > 11) {
%>
<%- (container.description || "") %>
<%
} %>
<%
(container.attachments || []).forEach(function(item) {
var desc = (item.description || '').replace(/(^\s+|\s+$)/igm, '');
var name = desc.length > 3 ? desc : (item.name || '').split('.').slice(0, -1).join('.').replace(/[_]/g, '\u0020');
var mimeClass = Utils.getMimetypeClassName(item.type || '');
%> - <%= name %>
<%
}); %>
<%
})(container, WebBaseAprovLV.lang, WebBaseAprovLV.Utils);
} %>
<% // Icon Container: [Icon Item]
if (container.system_type === "icon_box_container") {
(function(container, lang, Utils) {
var iconSectionBackgroundClass = (container.sectionbackground__background_type || []).length ? container.sectionbackground__background_type[0].codename : '';
var iconColClass = (container.columns || []).length ? container.columns[0].codename : 'lv_col_2';
var iconSize = (container.icon_size || []).length ? container.icon_size[0].codename : '';
var iconAlignement = (container.icon_alignment || []).length ? container.icon_alignment[0].codename : 'lv_icon_left';
var uniqueIconSectionClass = container.system_id;
uniqueIconSectionClass = uniqueIconSectionClass.substring(1, 8);
%>
<% if ((container.title || []).length>0) { %>
<%= container.title %>
<% } %>
<%
(container.container || []).forEach(function(icon) {
var iconClass = (icon.icon_class || []).length>0 ? (icon.icon_class): '';
var iconlinkUrl = '';
var imgUrl = (icon.icon_image || []).length>0 ? (icon.icon_image[0].url + '?w=80&fit=crop&fm=webp&lossless=0&q=75'): '';
var imgTitle = icon.title || '';
var boxClass = (icon.box_type || []).length ? icon.box_type[0].codename : 'lv_box';
var linkType = '';
if (icon.link_type && Array.isArray(icon.link_type)) {
icon.link_type.forEach(function(link_type) {
linkType = linkType + (link_type.codename || '');
});
};
var linkButtonText = (icon.link_text || []).length>0 ? (icon.link_text): Utils.gettext('More');
if ((icon.link_internal || []).length>0) {
iconlinkUrl = Utils.linkTo(['', lang, (icon.link_internal[0].url || '')].join('/'));
}
if ((icon.link_external || '').length>0) {
imgTitle = '[external Link]: ' + imgTitle;
iconlinkUrl = icon.link_external || '';
}
if ((iconlinkUrl || '').length === 0) {
iconlinkUrl = '';
}
%>
<%
}); %>
<%
})(container, WebBaseAprovLV.lang, WebBaseAprovLV.Utils);
} %>
<%
});
}
%>