From the course: The Freelance Stack: Real Project with Next.js and Strapi
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
Article intro component JSX - Next.js Tutorial
From the course: The Freelance Stack: Real Project with Next.js and Strapi
Article intro component JSX
So the next thing we're going to do is create our article intro component. So write this one here, and this will be the first time we're actually going to be working with the article content array, with that dynamic zone coming in from Strapi. What we're going to have to do here is we have to display the excerpt, but then on the other side here we have to create the table of content. So how are we going to do that? If we look at our data, what we have available here is inside of the article content, all those components right here. And how are we, where are we getting the headlines from? Well, all of these headlines here will be displayed one by one in the article of content. So what we got to do is, we have to go through this array of components, find all the ones where the blog article is headlined, save those, and then show them one by one. On top of that, what we want to do is that each one of those elements should link to the corresponding section within the article. the So if I…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
-
(Locked)
Create dynamic zone in Strapi for customizable blog content14m 6s
-
(Locked)
Creating data for highlight article8m 28s
-
(Locked)
Article hero section JSX5m 45s
-
(Locked)
Styling: Article hero section5m 26s
-
(Locked)
Article intro component JSX8m 40s
-
(Locked)
Styling: Article intro component5m 29s
-
(Locked)
Generic article component to render different component depending on Strapi data9m 14s
-
(Locked)
Article headline JSX3m 15s
-
(Locked)
Styling: Article headline1m
-
(Locked)
Text with image component JSX15m 9s
-
(Locked)
Styling: Text with image component5m 48s
-
(Locked)
Article paragraph JSX2m 23s
-
(Locked)
Styling: Article paragraph1m 6s
-
(Locked)
Image component JSX3m 49s
-
(Locked)
Styling: Image component2m 20s
-
(Locked)
Other articles section on individual blog page3m 17s
-
(Locked)
Blog section homepage JSX13m 11s
-
(Locked)
Styling: Blog section homepage8m 52s
-
(Locked)
Fix article item for featured items on homepage1m 18s
-
(Locked)
-
-