Frequently Asked Questions v2 |
FAQ Main / Answer Detail |
How can I parameterize a view and fill in details from the URL
Author: Mitra mitra@earth.path.net |
|
You can use aliases defined in the URL parameter 'als'. For a detailed description of the als parameter, see "What parameters can I use with slice.php3"
For example,
There are 13 navigation pages. For example, there is a page on 'Communication
Rights' which has a report on Internet Rights in general and links to the pages
'Communication Rights in South Africa'
'Communication Rights in Morocco'
'Communication Rights in Senegal'
etc...
I did not want to write 13 pages, so I used 2 static views -- one for country pages, and one for topic pages.
The topic page is /topic.shtml. It has this include
<!--#include virtual="/apc-aa/view.php3?vid=2-->
topic.shtml will be called with parameters. To create the 'Communication Rights' topic page, it will be called as
/topic.shtml?als[MY_TOPIC]=Communication+Rights&als[URLE_TOP]=Communication%2BRights
URLE_TOP is an alias similar to MY_TOPIC, but it double URL encodes the value. It will be used to generate links. %2B represents the +. A + in url encoding is a space.
In this topic.shtml I want to create links to these pages. To create these links, view #2 has this 'odd row' format:
<a href="/resource.shtml?cmd[1]=c-1-South%2BAfrica-c-2-_#URLE_TOP">South
Africa - _#MY_TOPIC </a>
<a href="/resource.shtml?cmd[1]=c-1-Morocco-c-2-_#URLE_TOP">Morocco
- _#MY_TOPIC </a>
<a href="/resource.shtml?cmd[1]=c-1-Senegal-c-2-_#URLE_TOP">Senegal
- _#MY_TOPIC </a>
and the MY_TOPIC and URLE_TOP are substituted from the als parameters in the
URL.
|
Last Edit: Aug 17 2011
<aafaq id=1738> ~ToDo: 1738 How can I parameterize a view and fill in details from the URL </aafaq>
This FAQ interface was developed by Jason at Commons.ca
|
APC
ActionApps is a free software content management system initiated by
the Association for Progressive Communications (APC) APC - Internet and ICTs for social justice and development |