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 A recordset is the result of executing an SQL query A query is a SQL command that will extract information from the tables of a database. Essentially, a query is a request for information from your database.. It is composed of multiple rows, each row having multiple columns. The columns presented in the query result depend on the column list declared in the query (they can belong to different tables). The number of rows and their order depend on the query conditions (WHERE, GROUP BY, HAVING, ORDER). The recordset acts as a source of dynamic data The InterAKT Dynamic Data tool is a replacement for the standard dynamic data dialog. It is used in the MX Kollection 3, to provide a unified way of building mark-ups, or place holders. These are recordset fields, server or session variables, and other types of dynamic data that are replaced at runtime by their corresponding values in web applications. 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.