Zope Zone Navigation
 
Document Actions
  • Print this page
  • Add Bookmarklet

Help needed w/ Plone Page Template in ZMI

Up to General

Help needed w/ Plone Page Template in ZMI

Posted by Christopher Nethery at November 21. 2006
I am trying to create a page template in the ZMI that functions in the following way:

1) Page contains two entry fields
2) The values from the entry fields become arguments for a ZSQL method
3) The results of executing the ZSQL method are output to the same page, below the initial entry form

When I test my page template, I receive a NameError, indicating that name ‘start_date’ is not defined.

I would assume that I need to use dtml tags, but I am unsure about how to implement them.

Here is what I have, so far:

ZSQL Method (DBTestQueryMethod):
------------

SELECT
FIRST_NAME, LAST_NAME FROM EMPLOYEES
WHERE
HIRE_DATE BETWEEN
<dtml-sqlvar "start_date" type=string>
AND
<dtml-sqlvar "end_date" type=string>

(I know, I won’t get the entire range with this query)


ZSQL Method Arguments:
----------------------
start_date, end_date

Plone Page Template:
--------------------

<html>

<head>

<title tal:content="template/title">The title</title>

</head>

<body>

<h1 id="title" tal:content="template/title">This is where the main heading goes</h1>

<form action="output.html" method="get"> Please Enter Start Date: <input type="string" name="start_date" width="30" value=""> Please Enter End Date: <input type="string" name="end_date" width="30" value=""> <input type="SUBMIT" name="SUBMIT" value="OK">

</form>

<table border=0>

<tr>
<th>First Name</th>
<th>Last Name</th>
</tr>

<div tal:repeat="result here/DBTestQueryMethod">

<tr>
<td><span tal:replace="result/FIRST_NAME ">FIRST_NAME goes here</span></td>
<td><span tal:replace="result/LAST_NAME"> LAST_NAME goes here</span></td>
</tr>

</div>
</table>



</body>
</html>


Page Property
-------------
dynamicContent boolean

I would be grateful for any direction you could provide me with.


Thanking you in advance,

Christopher A. Nethery
Powered by Ploneboard
 

Home Discussions General Help needed w/ Plone Page Template in ZMI