Displaying The Article Text
At this point you have all the tools you need to create /finalProject/public/articles.bxm using the other pages as example.
- Create a variable creates an instance of bookstore.common.articles.
- Call the function which queries the articles table based on the id submitted.
- Display the title and description fields on articles.bxm.
<bx:param name="articleId" default="0" />
<bx:set currentArticle = articleService.allArticles(id=articleId) />
<bx:output>
<bx:if currentArticle.len() EQ 0>
<h2>Article Not Found</h2>
<bx:else>
<h2>#currentArticle[1].title#</h2>
<div>
#currentArticle[1].description#
</div>
</bx:if>
</bx:output>