diff --git a/src/main/frontend/styles/main.scss b/src/main/frontend/styles/main.scss index 50bcb56..bcf35fb 100644 --- a/src/main/frontend/styles/main.scss +++ b/src/main/frontend/styles/main.scss @@ -217,8 +217,6 @@ html { } .home-header { - margin-bottom: 1.5rem; - &__columns { flex-direction: row-reverse; } diff --git a/src/main/resources/lib/labs/content-prep.js b/src/main/resources/lib/labs/content-prep.js index 52b813c..1c57f91 100644 --- a/src/main/resources/lib/labs/content-prep.js +++ b/src/main/resources/lib/labs/content-prep.js @@ -335,6 +335,13 @@ function processContentBlocks(ctbs) { block.ctb.ctbImages = processBlockImages(block.ctb.ctbImages) } + // Prepare gallery + if (block.ctb._selected === 'ctbGallery' && block.ctb.ctbGallery) { + // Duplicate fullwidth flag from settings, as it is needed in calculation + block.ctb.ctbGallery.isFullWidth = block.ctb.isFullWidth + block.ctb.ctbGallery = processBlockGallery(block.ctb.ctbGallery) + } + // Process links block if (block.ctb._selected === 'ctbLinks' && block.ctb.ctbLinks) { block.ctb.ctbLinks = processBlockLinkList(block.ctb.ctbLinks) @@ -447,6 +454,17 @@ var processBlockImages = function (b) { } exports.processBlockImages = processBlockImages +var processBlockGallery = function (b) { + b.galleryImages = util.forceArray(b.galleryImages) + var scale = 'width(1)' // No scaling is default + b.galleryImages = b.galleryImages.map(function (image) { + image = imageLib.image.create(image, scale) + return image + }) + return b +} +exports.processBlockGallery = processBlockGallery + var processBlockVideos = function (b) { const defaultAspectRatio = '16:9' var ratio diff --git a/src/main/resources/site/i18n/phrases_no.properties b/src/main/resources/site/i18n/phrases_no.properties index c9f1987..5ae2f98 100644 --- a/src/main/resources/site/i18n/phrases_no.properties +++ b/src/main/resources/site/i18n/phrases_no.properties @@ -74,6 +74,8 @@ ct.article.ctbCollection = Samling av innhold ct.article.ctbCollectionDesc = Predefinert sett med gruppert innhold ct.article.ctbImages = Bilder ct.article.ctbImagesDesc = 1-3 bilder +ct.article.ctbGallery = Bildegalleri +ct.article.ctbGalleryDesc = Bilder til galleri ct.article.ctbVideo = Video ct.article.ctbVideoDesc = Vimeo video fra video-id ct.article.ctbVideoId = Vimeo video-id @@ -109,6 +111,7 @@ parts.genericText.lead = Enkel tekst parts.genericText.body = Rik tekst (HTML) parts.blockLinkList = Generisk lenkeliste parts.blockImages = Generisk bildeblokk +parts.blockGallery = Generisk galleriblokk parts.blockCollection = Samling av innhold parts.article = Artikkel parts.category = Kategoriside (temaside) diff --git a/src/main/resources/site/mixins/contentblock/contentblock.xml b/src/main/resources/site/mixins/contentblock/contentblock.xml index cfcabd4..0b52da7 100644 --- a/src/main/resources/site/mixins/contentblock/contentblock.xml +++ b/src/main/resources/site/mixins/contentblock/contentblock.xml @@ -34,6 +34,19 @@ + + +