Manage Breadcrumbs with Contentstack

Contentstack simplifies the process of creating breadcrumbs for easy navigation. To create breadcrumbs in Contentstack, follow the steps given below:

  1. Create a content type named “Navigation” of type Content Block and set it as Multiple. Add the Link field along with the default “Title” field as shown below:

    Manage_Breadcrumbs_with_Contentstack_1_no_highlight.png
  2. For each "page" in the content type, add a Reference field named "Breadcrumb" with “Multiple” as the selected option that refers to the Navigation content type.Manage_Breadcrumbs_with_Contentstack_3_no_highlight.pngManage_Breadcrumbs_with_Contentstack_2_no_highlight.png
  3. You can then define your breadcrumb hierarchy while creating entries in your content type. Consider Products for example:Manage_Breadcrumbs_with_Contentstack_4_no_highlight.png

    Note: Make sure you add the breadcrumbs in the correct sequence.

  4. So, when you render the page in your front end layer, you have to get this entry by including the Reference field, Breadcrumb. Refer to our Content Delivery API documentation for more details.

    For example, when you run the GET API call: https://cdn.contentstack.io/v3/content_types/products/entries?environment=production&locale=en-us&include[]=breadcrumb, You will get the Reference field array as follows:

    json data of breadcrumb.png
  5. This is how you can render them on the page and the breadcrumb navigation will look like the following:
    navigation using breadcrumb.png

Was this article helpful?

Thanks for your feedbackSmile-icon

On This Page

^