in chapter 5 the example Creating a File Library has an error in the sorting method. <dtml-var standard_html_header> <h1>File Library</h1> <table> <tr> <th><a href="&dtml-URL0;?sort=name">File</a></th> <th><a href="&dtml-URL0;?sort=date">Last Modified</a></th> </tr> <dtml-if expr="_.has_key('sort') and sort=='date'"> ---ERROR-------------------------------------------------------------------- ------- <dtml-in expr="objectValues('File')" ~this should be <dtml-in expr="PARENTS[0].objectValues(['File'])" ~it doesn't work otherwise. ---ERROR-------------------------------------------------------------------- ------- sort="bobobase_modification_time" reverse> <tr> <td><a href="&dtml-absolute_url;"><dtml-var title_or_id></a></td> <td><dtml-var bobobase_modification_time fmt="aCommon"><td> </tr> </dtml-in> <dtml-else> ---ERROR-------------------------------------------------------------------- ------- <dtml-in expr="objectValues('File')" sort="id"> ~same as above. ---ERROR-------------------------------------------------------------------- ------- <tr> <td><a href="&dtml-absolute_url;"><dtml-var title_or_id></a></td> <td><dtml-var bobobase_modification_time fmt="aCommon"><td> </tr> </dtml-in> </dtml-if> </table> <dtml-var standard_html_footer> -<mike>-
michael angelo ruberto wrote:
in chapter 5 the example Creating a File Library has an error in the sorting method.
---ERROR-------------------------------------------------------------------- -------
<dtml-in expr="objectValues('File')"
~this should be <dtml-in expr="PARENTS[0].objectValues(['File'])" ~it doesn't work otherwise.
The reason why it doesn't is because you are using a DTML Document instead of a DTML Method: DTML can help you save time maintaining this library. Create an *index_html* DTML Method in the *Files* folder to list all the ^^^^^^^^^^^ files in the library:: -Michel
participants (2)
-
michael angelo ruberto -
Michel Pelletier