Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experiment-driven Update: Quicklinks in header #6178

Merged
merged 11 commits into from
Oct 18, 2024

Conversation

john-rock
Copy link
Contributor

@john-rock john-rock commented Sep 30, 2024

What are you changing in this pull request and why?

This pull request adds support for dynamic CTAs in the Guides hero component, extending functionality introduced during this experiment experiment.

The updated component allows either CTAs that are added to include a link or (in the case of the experiment) an on click event. For this version the on click applies a filter to the guides in the same manner as the experiment.

Key Changes:

  • CTA title can now be set in the Hero.
  • CTAs can now be added to the Hero and support two actions:
    • Linking: Direct users to a URL.
    • On-Click Events: Trigger JavaScript functions, such as applying a filter to the guides list (as done in the experiment).
  • The filtering behavior has been aligned with the experimental version to ensure consistency in user interaction.

Preview Link

https://docs-getdbt-com-git-experiment-apply-quicklink-hero-dbt-labs.vercel.app/guides

How to Use the Updated Guides Hero Component

To use the new CTA functionality, follow these steps:

  1. Locate the heroCTAs Array:

    • In the quickstartGuideList/index.js file, you will find a heroCTAs array.
    • This array consists of objects, each containing two properties:
      • title: This will be the displayed text of the CTA.
      • value: This corresponds to the URL query parameter that will be appended when the CTA is clicked, applying the filter.
  2. Ensure Proper value Mapping:

    • The value property must match an existing tag in the Topic dropdown for the filter to work correctly.
    • When a CTA is clicked, the value is passed as a query parameter, filtering the guides in the same way as manually selecting the topic from the filter dropdown.

Example using onClick:

const heroCTAs = [
  {
    title: 'Quickstart Guides',
    value: 'Quickstart' // Must match a tag in the Topic dropdown
  },
  {
    title: 'Use Jinja to improve your SQL code',
    value: 'Jinja' // Must match a tag in the Topic dropdown
  }
];

Example using href:

const heroCTAs = [
    {
      title: 'Sign up for dbt Cloud',
      href: 'https://www.getdbt.com/signup',
      newTab: true
    }
];

Why this change?

This update enhances the flexibility of the Guides hero component, allowing for more interactive CTAs that either navigate users to external pages or trigger in-page filtering, improving the overall UX based on lessons learned from the experiment.

Before merging

  • Confirm if we are launching with the buttons set in this PR

@john-rock john-rock requested a review from a team as a code owner September 30, 2024 18:17
Copy link

vercel bot commented Sep 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
docs-getdbt-com ✅ Ready (Inspect) Visit Preview Oct 18, 2024 5:20pm

@github-actions github-actions bot added the size: medium This change will take up to a week to address label Sep 30, 2024
@john-rock
Copy link
Contributor Author

john-rock commented Sep 30, 2024

Hi @runleonarun 👋

Quick question for you – this PR implements the values we used in the previous experiment that added the ability to filter via buttons in the Guides page hero. Since we’re not currently running that experiment, would you prefer I:

  1. Merge this PR without any CTAs in the hero, or
  2. Merge it with the current CTAs that are already set in the hero?

Let me know which you prefer!

Copy link
Collaborator

@JKarlavige JKarlavige left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really digging this feature! Just have one note on how URLs should be handled when trying to link to from the CTAs

website/src/components/hero/index.js Outdated Show resolved Hide resolved
website/src/components/quickstartGuideList/index.js Outdated Show resolved Hide resolved
Copy link
Collaborator

@JKarlavige JKarlavige left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!! 🚢

// The value of the tag must match a tag in the frontmatter of the guides in order for the filter to apply after clicking
const heroCTAs = [
{
title: 'Quickstart Guides',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sugg sentence case

Suggested change
title: 'Quickstart Guides',
title: 'Quickstart guides',

Copy link
Contributor

@mirnawong1 mirnawong1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@john-rock john-rock merged commit 42975b2 into current Oct 18, 2024
7 checks passed
@john-rock john-rock deleted the experiment/apply-quicklink-hero branch October 18, 2024 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: medium This change will take up to a week to address
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants