A drop-down list for presenting a list of articles

It is easy to make a drop-down list in an HTML form which gives instant access to the selected article.

If the URLs of the site’s articles are in the form #URL_PAGE{article, id_article=123}, the following code will do the trick:

<form action="#URL_PAGE{article}" METHOD="get">

	<select name="id_article">
		<BOUCLE_menu_articles(ARTICLES) {id_rubrique} {par titre}>
		<option VALUE="#ID_ARTICLE">#TITRE</option>
		</BOUCLE_menu_articles>
	</select>

	<input type="submit" name="Validate" value="Go to article">
</form>

The criteria of the loop can be changed according to your needs. In the example given the articles of the current section will be shown, sorted by title.

This method can be used just as well to present lists of news items or sections. It could even be used to show the complete list of items in the site.

Author Paolo Published : Updated : 29/06/23

Translations : عربي, català, English, Español, français, italiano, Nederlands, svenska, Türkçe, українська