Skip to content

Commit

Permalink
Breadcrumb - Adding toggle to show/hide (#1065)
Browse files Browse the repository at this point in the history
  • Loading branch information
amankumarrr authored Jul 18, 2023
1 parent aad3a36 commit 6ade005
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .tina/__generated__/_graphql.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .tina/__generated__/_schema.json

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions .tina/collections/industry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ export const industrySchema: Collection = {
label: "Page Subheading",
name: "subHeading",
},
{
type: "boolean",
name: "showBreadcrumb",
label: "Show Breadcrumb",
},
{
type: "image",
label: "Banner Image",
Expand Down
7 changes: 6 additions & 1 deletion .tina/collections/training.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Collection } from "tinacms";
import * as Schemas from "../../components/blocks";
import { testimonialRowSchema } from "../../components/testimonials/TestimonialRow";
import { trainingHeaderSchema } from "../../components/training/trainingHeader";
import { seoSchema } from "../../components/util/seo";
import { videoCardSchema } from "../../components/util/videoCards";
import { testimonialRowSchema } from "../../components/testimonials/TestimonialRow";

export const trainingSchema: Collection = {
label: "Training Pages",
Expand All @@ -27,6 +27,11 @@ export const trainingSchema: Collection = {
name: "title",
label: "Title",
},
{
type: "boolean",
name: "showBreadcrumb",
label: "Show Breadcrumb",
},
{
type: "boolean",
name: "showTestimonials",
Expand Down
1 change: 1 addition & 0 deletions content/industry/finance.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ seo:
description: >-
SSW designs personalized financial software solutions to enhance security,
simplify compliance, and enrich your client relationships.
showBreadcrumb: false
---

### Overview
Expand Down
2 changes: 2 additions & 0 deletions content/training/internship-fullstack.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ footer: >
testimonials:
tagline: Hear from some of our past students who are now working in the industry
showTestimonials: true
showBreadcrumb: false
---


Expand All @@ -203,3 +204,4 @@ showTestimonials: true




12 changes: 7 additions & 5 deletions pages/industry/[filename].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,13 @@ export default function IndustryPage(
sizes="100vw"
/>
)}
<Breadcrumbs
path={removeExtension(props.variables.relativePath)}
suffix=""
title={pageData.seo.title}
/>
{pageData.showBreadcrumb && (
<Breadcrumbs
path={removeExtension(props.variables.relativePath)}
suffix=""
title={pageData.seo.title}
/>
)}
<h1 className="mb-1 py-0 text-3xl">{pageData?.heading}</h1>
<h2 className="!mt-1 pt-0 text-md font-light">
{pageData?.subHeading}
Expand Down
16 changes: 9 additions & 7 deletions pages/training/[filename].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@ export default function TrainingPage(
<Layout>
<TrainingCarousel data={data.training.trainingHeaderCarousel} />
<Container padding={"md:px-8 px-0"} className="pt-2">
<div className="px-8 md:px-8">
<Breadcrumbs
path={removeExtension(props.variables.relativePath)}
suffix={data.global.breadcrumbSuffix}
title={data.training?.seo?.title}
/>
</div>
{data.training.showBreadcrumb && (
<div className="px-8 md:px-8">
<Breadcrumbs
path={removeExtension(props.variables.relativePath)}
suffix={data.global.breadcrumbSuffix}
title={data.training?.seo?.title}
/>
</div>
)}
<h1
className="py-0 text-center text-5xl font-semibold"
dangerouslySetInnerHTML={{ __html: data.training.title }}
Expand Down

0 comments on commit 6ade005

Please sign in to comment.