Source (Text):
<dtml-comment>
Create a dtml method called sql_doc, this is almost identical to
pups code with a couple of changes. You will want to replace the
string YOUR_FOLDER_HERE with the actual name of the top level zope
folder that hold your zsql.
</dtml-comment>
<dtml-in "ZopeFind(restrictedTraverse(['YOUR_FOLDER_NAME']),obj_ids=[newid], obj_metatypes=['Z SQL Method'], search_sub=1)">
<h2>&dtml.-newid; (&dtml.-title_or_id;)</h2>
<p><i><a href="<dtml-var absolute_url>/manage" target="_new"><dtml-var absolute_url></a></i></p>
<blockquote><pre><dtml-var "template"></pre></blockquote>
<b>Max Rows:</b> <dtml-var "max_rows_"> /
<b>Max Cache:</b> <dtml-var "max_cache_"> /
<b>Cache Time:</b> <dtml-var "cache_time_"> /
<b>Class:</b> <dtml-var "class_name_"> /
<b>Class File:</b> <dtml-var "class_file_"> /
<b>Direct:</b> <dtml-var "allow_simple_one_argument_traversal">
</dtml-in>
<dtml-comment>
Then create another dtml method called sql_map with the following
code. Notice that sql_doc is hardcoded to reference the above method,
change to reference what ever you called the first method.
</dtml-comment>
<dtml-var standard_html_header>
<dtml-tree branches_expr="objectValues(['Folder', 'Z SQL Method'])" nowrap=1 sort=id>
<dtml-if expr="meta_type == 'Folder'">
<IMG SRC="<dtml-var SCRIPT_NAME>/<dtml-var icon>"><dtml-var title_or_id>
<dtml-else>
<IMG SRC="<dtml-var SCRIPT_NAME>/<dtml-var icon>">
<A HREF="<dtml-var absolute_url>/sql_doc?newid=<dtml-var id>"><dtml-var id> (<dtml-var title>)</a>
</dtml-if>
</dtml-tree>
<dtml-var standard_html_footer>
|