~M•29
Published on

What are Nested Types?

Authors
  • avatar
    Name
    MDolce
    Twitter
Table of Contents

Problems we need to solve:

Associating Projects with Case Studies. [Concept Only]

Building on Project 04 - Thinking About Case Studies, we need to begin thinking about associating Case Studies and Projects with a one-to-many association. One method of association is using an id as part of a future modelled schema using MongoDB with Mongoose.

This project will establish a Category type for Case Studies. Defined as a nested type for allBlogs or Blogs, this process will set up the initial workflow for filtering and mapping data based on category type.

An interim solution while we work on resources is to create a new definedNestedType or Field Type Reference

The goal is to make it easier to track and associate related content beyond just using tags and links.


Establishing requirements for our methodology:

  1. Redefine workflowID for Blogs by converting the workflowID into a definedNestedType using examples for: (https://contentlayer.dev/docs/reference/source-files/field-types-defe41e9#reference).
  2. Create a new directory for Case Studies.
  3. Add new definedNestedType as a field in the WorkflowID.
  4. Create a listing page for Case Studies filtering the workflowID.
  5. Replace Internal Pages section with a list or grid layout of Case Studies with Associated Projects.

Challenges:

  • Dynamically/manually adding the workflowID to the front matter for associated blog content.
  • Updating source code to recognize the workflowID in the search component

Solution?

-[ ] Interim solution is to create a filter to load content based on tags.

REF(s):

Internal Pages

Project 03: Established UAT

Project 04 - Thinking About Case Studies

Project 06 - defineNested Types

External Site Reference & Functional Concepts

Contentlayer: defineNestedType | https://contentlayer.dev/docs/reference/source-files/define-nested-type-eeeb4ab5

Contentlayer: Field Types Reference | https://contentlayer.dev/docs/reference/source-files/field-types-defe41e9

Cules Coding: Lesson 04 - MDX, MongoDB Static Homepage | https://www.youtube.com/watch?v=kPG07USpnes