Documente online.
Zona de administrare documente. Fisierele tale
Am uitat parola x Creaza cont nou
 HomeExploreaza
upload
Upload




Creating the Article List

computers


Creating the Article List

Next, you edit the topic.php file. This page displays a list of articles assigned to a specific topic that a user selected from the menu. Conceptually, the page is constructed in the same way as the index.php page. The only difference is that the page filters the recordset you use by the topic id, which the URL parameter passes.

Note: You can filter records in a database base 15215y243p d on the equality of a parameter's value with a record column's value. This yields a limited set of records that satisfy a certain condition (in your case, the records belong to the same topic).



Open the topic.php page and apply the template to it, as described for the index.php page.

In the title field of the Document bar, enter Blog: Topic as the title of the page.

Creating a Filtered Recordset

To create a filtered recordset, you proceed just as you do with a normal recordset, with one exception: In the Recordset dialog box, you specify the filter condition as shown in Figure 19.

Figure 19. The Recordset dialog box showing the rsArticles recordset and a filter condition

As you can see, the idtop_art field value must be equal to the value of the id_top URL parameter.

Click the Advanced button to add the join condition immediately after blg_article_art:

INNER JOIN blg_topic_top ON idtop_art=id_top

Next, you display the data from the filtered recordset using a dynamic table, as described for index.php. Create the dynamic table using the the rsArticles recordset you just created.

Now use the following steps to format and clean up the dynamic table

  1. Select the dynamic table by clicking the corresponding <table> tag from the tag selector. Set the table width to 100% in the Property inspector.
  2. Select the following columns from the table and delete them: id_art idtop_art text_art id_top, and description_top. You can select table columns by clicking inside the table, clicking the down arrow above each column in the table, and selecting select column from the pop-up menu. Then press your delete key. If you do not see the down arrow, ensure you have the table widths visual aid enabled (View > Visual Aids > Table Widths).
  3. Delete the first table row.
  4. Select the remaining row, right-click it and select Table > Insert Row from the pop-up menu.
  5. Select the left two cells in the top row and merge them by clicking the merge cells button in the Property inspector.
  6. Select the right two cells in the top row and merge them by clicking the merge cells button in the Property inspector.
  7. Select the dynamic text and drag it to the top left table cell.
  8. Select the dynamic text and drag it to the top right table cell.
  9. Type Published: to the right of the dynamic text.
  10. Select the dynamic table by clicking the corresponding <table> tag from the tag selector and press your left arrow key so the cursor is to the left of the table.
  11. With the cursor to the left of the table, insert another table (Insert > Table). Assign the table the following values: 1 row, 1 column, 100% width, 0 CellSpace and 0 CellPad.
  12. You do not need to display the dynamic text for each article, since the topic is the same for all articles. Select the dynamic text and drag it above into the new table you just created. This will put it outside the the repeat region in the lower table. You may want to disable the table widths visual aid if it is in the way (View > Visual Aids > Table Widths).
  13. Enclose the dynamic text in quotes and write Articles in before it.
  14. In the second table row in the lower table, select all of the cells and merge them.
  15. Place your cursor to the right of the dynamic text and press Enter.
  16. Insert a horizontal rule to separate the articles (Insert > HTML > Horizontal Rule).
  17. Save and put the file to the server. Also make sure the index.php file is on the server.
  18. In your browser, navigate to the index.php file. If you populated the database using the data.sql file mentioned earlier, you will see the topics show up on the article.php page when you click the topic links in the right nav of the index.php page.

Create the necessary link between the article title and the article.php page, passing it the URL parameter id_art, which is equal to the id_art field from the rsArticles recordset. Review the section on dynamic links if you're unsure of how to do this.

The page should look like this in Design view:

Figure 20. The page in Design view

(+) View larger

In the next section, you will learn to display an article in full.


Document Info


Accesari: 1174
Apreciat: hand-up

Comenteaza documentul:

Nu esti inregistrat
Trebuie sa fii utilizator inregistrat pentru a putea comenta


Creaza cont nou

A fost util?

Daca documentul a fost util si crezi ca merita
sa adaugi un link catre el la tine in site


in pagina web a site-ului tau.




eCoduri.com - coduri postale, contabile, CAEN sau bancare

Politica de confidentialitate | Termenii si conditii de utilizare




Copyright © Contact (SCRIGROUP Int. 2024 )