Display article lists

In this section of the tutorial you will build a page that displays article lists. What this page will display is the article referenced by the URL parameter id_pag (on top of the page), together with all articles that have the self-foreign key equal to the ID passed through the URL parameter (the articles that belong to the list). For each article, only the title and description are displayed. In order to read the entire content, a link will be displayed.

To build this page, follow the next steps:

  1. Open the \front\view_list.php page. This is where you will display article lists.

  2. Create a recordset with the article list whose URL parameter is passed from the men


     

  3. Create another recordset with all the articles belonging to the current list.


     

  4. Drag dynamic text from the first recordset (rsArticleList) in your page and format it to look like this:


     

  5. Drag and drop the title_pag and description_pag fields from the rsArticles recordset in the Bindings tab onto the page, in a new paragraph below the first section. Also add a link to the view_art page, named "Read more" and make sure to pass the id_pag URL parameter retrieved from the rsArticles recordset. This will display one of the records from the second recordset, but in order to display them all, you need to apply a Repeat region on the entire area


     

  6.  Save the page and preview it in the browser. Pass it an ID as the id_pag URL parameter manually, or use the menu created in the previous topic. The result should look like the following:

 

In the next topic you will display the full article in the view_art page.