Hi Nate:

On 15/06/2010 1:07, Nate Aune wrote:
1) I want to make the template handle for Plone 3 and Plone 4, and I'm
trying to do these checks in the .tmpl file, like so:

parts =
#if $plone_major<  4
     zope2
#end if

where $plone_major is an integer that is filled out on the web form
(as either 3 or 4).

it doesn't appear that these values are being evaluated, and it's
always choosing Plone 4.

should i be doing this check in the plone_hosting.py file, as in:

        plone=vars["plone_version"]
        if plone.startswith("4."):
            do something
The .tmpl option works for me. I could successfully create a plone 4 and plone 3 hosting project. Can I suggest to remove the plone_major from the vars definition and set it in a pre method? It's there in the code, as I can see. Don't know why you commented it out.
2) Is it possible to do conditional display of questions? For example,
if they say they want to install Apache, then I need to ask them what
port they want to run it on on the next page, but if they choose not
to install Apache, then I don't want to show this question at all.
I guess that the only way of doing this is by changing zopeskel.vars.var class by adding some new parameters to the vars. Something like:
class var(base_var):
...
  def __init__(....):
    self.name = name
    ...
self.precondition = "some string with a very strict syntax that should evaluate to True/False"

Then, a new check_vars method in zopeskel.base.BaseTemplate class should be added (or updated) to handle these preconditions.

Of course, it's easy for me to say this :)
3) Can you hide an entire page depending on the answer to a previous
question? For example, if I ask them if they want to deploy the
buildout to a hosting provider, and they answer yes, then on the next
page I want to ask them all the hosting provider information. If they
answer no, then I don't want to show that page at all.
I suppose that by using preconditions (or something similar) like above you should be able to manage hiding based on pages.
Thanks,
Nate

Hope this helps

Regards

*Marcos F. Romero*
Responsable de Desarrollo
Inter-Cultura

marcos.rom...@inter-cultura.com <mailto:marcos.rom...@inter-cultura.com>
www.inter-cultura.com <http://www.inter-cultura.com/>
+54 11 4542-8299

_______________________________________________
ZopeSkel mailing list
ZopeSkel@lists.plone.org
http://lists.plone.org/mailman/listinfo/zopeskel

Reply via email to