From the course: Building Full-Stack Applications with HTMX

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Solution #3: Viewing an article

Solution #3: Viewing an article

- [Instructor] So now that you have tried out a third task, let us solve it together and then compare results. Ready? Let's go. So, the first step tells us to create a new template called articleDetail. This template should display the title and the full article. It should also show the date the article was posted and a link back to the article's page. So, let us write that. We're going to have that in our Templates folder, articleDetail.js. And now let us write out this template. Good. So this template takes in an article, and for that article, we simply create a card, and the card will display the title of the article. We display the full content, then we have a button that goes back to our home page. This goes back to our home page, it reads back to articles. And down there at the footer, we display the date the article was created in a more human-readable form. So, that's our template. For step two, we have to create the route, /articles... Let me go to step two here, we have to…

Contents