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.
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.
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
<table>
tag
from the tag selector. Set the table width to 100% in the Property
inspector.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).
dynamic text and drag it to the top left table cell.
dynamic text and drag it to the top right table cell.
dynamic text.<table>
tag
from the tag selector and press your left arrow key so the cursor is to
the left of the table.
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).
dynamic text in quotes and write Articles in
before it.
dynamic
text and press Enter. 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:
(+) View larger
In the next section, you will learn to display an article in full.
|