I have asked this question somewhat differently in another thread but here I
go again from another angle, as it might have been my approach that was
wrong to begin with.

I have a Python product that allready does what I want it to, but I want to
be able to create different views of the products content. (Model View
Controller principle). To do this I have created a folder with different
views (Or skins if you would prefer the Gnome/KDE way of saying it.)

views
    view1
        list.dtml
        view.dtml
        edit.dtml
    view2
        list.dtml
        view.dtml
        edit.dtml

In my class I have made a value that hold the name of the selected view, I
call this:

self.selView

I want to make it possible to use the different sets of dtml files to create
a different look and feel to the data.

I want to write my "index_html" method so that it returns a rendered version
of "list.dtml" corresponding to the selected view, by the name of the folder
holding  the selected view.

something like this (which doesn't work):

def index_html():
    return HTMLFile('views/' + self.selView+ 'list')

Is that the best way to do it?

Regards
        
        Max M

_______________________________________________
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to