Skip to content

Commit

Permalink
Merge pull request #290 from hlxsites/289-danaher-unified-search
Browse files Browse the repository at this point in the history
289 Adding link to Danaher Unified Search
  • Loading branch information
davenichols-DHLS authored Jan 23, 2024
2 parents 4871d6e + 619fc7a commit 8ca5144
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
11 changes: 11 additions & 0 deletions blocks/header/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ function createHeadingElement(input) {
return heading;
}

function createUnifiedElement(input) {
const unified = document.createElement('span');
unified.innerHTML = `Want to Search across all Life Sciences Companies of Danaher? <a href="https://lifesciences.danaher.com/us/en/danahersearch.html#q=${input}" target="_blank">Explore Danaher Unified Search</a>`;
unified.classList.add('search-unified');
return unified;
}

function createCountElement(resultsLength, total) {
const count = document.createElement('p');
count.className = 'search-info';
Expand Down Expand Up @@ -164,6 +171,9 @@ function createSearchResultsBlock(results, input, total) {
// Create GCSE box container
const gcseBox = createGcseBox();

// Create Unified Search element
const unified = createUnifiedElement(input);

// Create heading element
const heading = createHeadingElement(input);

Expand All @@ -173,6 +183,7 @@ function createSearchResultsBlock(results, input, total) {
// Append elements to the searchResultsBlock
const outer = gcseBox.querySelector('.mmg-gcse-outer');
outer.appendChild(heading);
outer.appendChild(unified);
outer.appendChild(count);

// Create individual result elements
Expand Down
12 changes: 12 additions & 0 deletions styles/gcse.css
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,18 @@ body.mmg-search-active {
padding: 40px 0
}

#mmg-gcse .search-unified {
display: block;
padding: 0 0 15px;
font-size: 16px;
color: white
}

#mmg-gcse .search-unified a {
font-size: 16px;
color: yellow
}

#mmg-gcse .search-title {
padding: 0 0 5px;
font-size: 32px;
Expand Down

0 comments on commit 8ca5144

Please sign in to comment.