From 731881c829ff1ab8861f62bedd7c87682da3ce5c Mon Sep 17 00:00:00 2001 From: Jingle Huang <32369333+JingleH@users.noreply.github.com> Date: Fri, 23 Jun 2023 15:41:37 -0700 Subject: [PATCH] [To Stage] Template v2 fixes (#916) * update templatelist-horizontal + browse-by-cat max-width * bro-by-cat css * searchMar show by default * breadcrumbs handle missing shortTitle --------- Co-authored-by: Jingle Huang --- .../blocks/browse-by-category/browse-by-category.css | 11 +++++++---- express/blocks/template-list/breadcrumbs.js | 7 ++++++- express/blocks/template-list/template-list.css | 2 +- express/scripts/ckg-link-list.js | 3 ++- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/express/blocks/browse-by-category/browse-by-category.css b/express/blocks/browse-by-category/browse-by-category.css index 01f6f5efb..af055f341 100644 --- a/express/blocks/browse-by-category/browse-by-category.css +++ b/express/blocks/browse-by-category/browse-by-category.css @@ -193,13 +193,16 @@ main .browse-by-category-wrapper.fullwidth { } @media (min-width: 900px) { - main .browse-by-category-wrapper .browse-by-category { + main .section .browse-by-category-wrapper { padding: 0 28px; + } + + main .section .browse-by-category-wrapper { max-width: none; - } + } main .browse-by-category .browse-by-category-heading-section { - flex-direction: row; - padding: 0; + flex-direction: row; + padding: 0; } } diff --git a/express/blocks/template-list/breadcrumbs.js b/express/blocks/template-list/breadcrumbs.js index a15ad292d..2797e6db6 100644 --- a/express/blocks/template-list/breadcrumbs.js +++ b/express/blocks/template-list/breadcrumbs.js @@ -32,8 +32,13 @@ function getCrumbsForSearch(templatesUrl, allTemplatesMetadata, taskCategories) if (!tasks && !topics) { return crumbs; } + const shortTitle = getMetadata('short-title'); + if (!shortTitle) { + return crumbs; + } + const lastCrumb = createTag('li'); - lastCrumb.textContent = getMetadata('short-title'); + lastCrumb.textContent = shortTitle; crumbs.push(lastCrumb); if (!tasks || !topics) { return crumbs; diff --git a/express/blocks/template-list/template-list.css b/express/blocks/template-list/template-list.css index 096a89219..0aeb20806 100644 --- a/express/blocks/template-list/template-list.css +++ b/express/blocks/template-list/template-list.css @@ -2339,7 +2339,7 @@ main .template-list-fullwidth-apipowered-container nav ol.templates-breadcrumbs main .template-list.horizontal .carousel-container { margin-left: auto; margin-right: auto; - max-width: 470px; + max-width: none; display: block; } diff --git a/express/scripts/ckg-link-list.js b/express/scripts/ckg-link-list.js index 62650dc83..b2f3b939e 100644 --- a/express/scripts/ckg-link-list.js +++ b/express/scripts/ckg-link-list.js @@ -292,7 +292,8 @@ function hideAsyncBlocks() { (async function updateAsyncBlocks() { hideAsyncBlocks(); // TODO: integrate memoization - if (document.body.dataset.device === 'desktop' && ['yes', 'true', 'on', 'Y'].includes(getMetadata('show-search-marquee-link-list'))) { + const showSearchMarqueeLinkList = getMetadata('show-search-marquee-link-list'); + if (document.body.dataset.device === 'desktop' && (!showSearchMarqueeLinkList || ['yes', 'true', 'on', 'Y'].includes(showSearchMarqueeLinkList))) { await lazyLoadSearchMarqueeLinklist(); } await lazyLoadLinklist();