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.
Create button from InfoBlock Strapi data on page - Next.js Tutorial
From the course: The Freelance Stack: Real Project with Next.js and Strapi
Create button from InfoBlock Strapi data on page
Now, we're already very close to finishing a huge part off here, because we now are able to display our data on the front end that comes through Strapi. But what's missing is the button here and here, so we're going to take care of that now. The way we are going to take care of that is also in the cleanest way I could think of doing that, which also means there's a little bit more work involved now, but it's just going to make it so much nicer to work with after. So if we go into our info block here, we just log out the data.button, we're going to see the kind of data that actually comes through from our, from Strapi. Now it's not very complex data, but what we need to create from that data is a button that will change depending on all of these values. So for me, the way that it makes the most sense here is to actually create your own helper function to create that kind of HTML element. So what we're going to do here is we're going to export, actually we don't have to export it 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)
Creating InfoBlock content type on Strapi14m 57s
-
(Locked)
Use single content type in Strapi to create InfoBlocks per page17m 33s
-
(Locked)
Fetch InfoBlock data on Strapi8m 27s
-
(Locked)
Fetch data from Strapi and process it16m 57s
-
(Locked)
Render InfoBlocks on page9m 20s
-
(Locked)
Create button from InfoBlock Strapi data on page7m 13s
-
(Locked)
Render InfoBlocks on experience page4m 45s
-
(Locked)
-
-
-
-
-