[Zope] DTML problem
I have a problem writing a DTML page. The page will be used to submit data to an SQL database, and the page itself is working great, however I get all of my users to login via an LDAP server using LDAPUserFolder. Once logged in the users can complete a form, click submit and the data is stored (along with their userID and date and time). Problem is, I also want to store the full name (or CN attribute in LDAP tree). I know in ZPT I can use b tal:condition=cnLogged in as: /b font color=#00strongspan tal:replace=cnreplace cn/span/strong/font/span and this works great but I cannot manage to work it out in DTML. Below is my page code (Hope you can help!) Thanks Phil dtml-call REQUEST.set('user',AUTHENTICATED_USER.getUserName()) html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en metal:use-macro=here/main_template/macros/master i18n:domain=plone body div metal:fill-slot=main body bgcolor=#FF table width=100% border=0 td width=80%form name=Add_student_modules method=post action=add_stu_modules_method enctype=multipart/form-data input type=hidden name=userid value=dtml-var user input type=hidden name=datetime value=dtml-var ZopeTime() fmt=fCommon input type=hidden name=name value=dtml-var name table width=90% border=0 cellspacing=0 cellpadding=2 align=center tr td colspan=2 class=standard align=center bgcolor=#D6DBDFstrongSubmit Module Choices/strong/td /tr tr td width=101 bgcolor=#D6DBDFnbsp;/td td width=419nbsp;/td/tr tr td width=101 align=right bgcolor=#D6DBDF class=standardbChoice 1/b/td td width=419 select name=choice1 option value=APC101APC101 - Accounting, Planning and Control/option option value=BUS999BUS999 - Marketing Business Enterprise/option option value=HRM121HRM121 - Human Resource Management/option option value=SIM222SIM222 - Strategy and International Management/option option value=PSY666PSY666 - Psychology/option option value=LAW421LAW421 - Law/option option value=ADM555ADM555 - Administration/option option value=TEC834TEC834 - Technical/option /select/td/tr tr td width=101 align=right bgcolor=#D6DBDF class=standardbChoice 2/b/td td width=419 select name=choice2 option value=APC101APC101 - Accounting, Planning and Control/option option value=BUS999BUS999 - Marketing Business Enterprise/option option value=HRM121HRM121 - Human Resource Management/option option value=SIM222SIM222 - Strategy and International Management/option option value=PSY666PSY666 - Psychology/option option value=LAW421LAW421 - Law/option option value=ADM555ADM555 - Administration/option option value=TEC834TEC834 - Technical/option /select/td/tr td width=101 bgcolor=#D6DBDFnbsp;/td td width=419 input type=submit name=Submit value=Submit input type=reset name=Submit2 value=Clear/td/tr /table /form/td /tr /table /div /body /html begin:vcard fn:Phil Beardmore n:Beardmore;Phil org:University of Sunderland;Sunderland Business School email;internet:[EMAIL PROTECTED] title:Senior IT/Network Officer tel;work:0191 515 3436 tel;cell:07766805820 version:2.1 end:vcard ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] DTML problem
Hi! I use the following expression in a header file which is included in every document/method to get the content of the actual folder and show the title as menue item. dtml-in expr="PARENTS[0].objectValues(['DTML Document'])" sort=title tr tda href="dtml-var "absolute_url()""dtml-var title/a/td /tr /dtml-in But I don't want to show the current "DTML Document" as part of the menue. example: Communication (Folder) | | |- default_html_header (DTML Method) | |- Contact (Folder) | | | |- index_html (DTML Document) | |- contact_addForm (DTML Document) | |- | |- News (Folder) . | . |- index_html (DTML Document) |- ok, default_html_header uses the dtml expression above and is included in every other document/method/whatever ... contact_addForm includes default_html_header and I don't want to show contact_addForm in the menue How can I exclude the current document? TIA Wolfgang ___ 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 )
Re: [Zope] DTML problem
this is probably a hack but you could use the id of the document you want to exclude with an unless statement. this is what i did when i wanted to exclude the index_html doc dtml-in "PARENTS[0].objectValues(['DTML Document'])" reverse sort=bobobase_modification_time dtml-unless "_.string.find(_['id'],'index_html')==0" pa href="dtml-var URL1/dtml-var id"dtml-var title/abr dtml-if jdatedtml-var jdatebr/dtml-if dtml-if summary dtml-var summarybr/dtml-if last modified: dtml-var bobobase_modification_time fmt=pCommonp /dtml-unless /dtml-in hth Regards, GEORGE DONNELLY [EMAIL PROTECTED] http://cyklotron.com/ Part of becoming a writer is the desire to have everything mean something. --Louise Erdrich But I don't want to show the current "DTML Document" as part of the menue. ___ 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 )
Re: [Zope] DTML problem
Wolfgang Klinger wrote: Hi! I use the following expression in a header file which is included in every document/method to get the content of the actual folder and show the title as menue item. dtml-in expr="PARENTS[0].objectValues(['DTML Document'])" sort=title tr tda href="dtml-var "absolute_url()""dtml-var title/a/td /tr /dtml-in But I don't want to show the current "DTML Document" as part of the menue. IIRC, I do something like this dtml-in expr="PARENTS[0].objectValues(['DTML Document'])" sort=title dtml-unless "this() == _['sequence-item']" tr tda href="dtml-var "absolute_url()""dtml-var title/a/td /tr /dtml-unless this is the document /dtml-in But I could be wrong, I don't have it handy, ATM. -- Do not meddle in the affairs of sysadmins, for they are easy to annoy, and have the root password. ___ 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 )
Re: [Zope] DTML Problem (from the newbie hair ripper category)
Darin Lee writes: Here is the proverbial rub. If I want to *test* for the presence of "navigation_name" so I can print "title_or_id" if it's not defined, Zope simply skips the "navigation_name" property. It's like it always evaluates to false! dtml-in "objectValues(['Category'])" dtml-with sequence-item dtml-if "hasProperty('navigation_name')" dtml-var navigation_name dtml-else dtml-var title_or_id /dtml-if /dtml-with /dtml-in Doesn't work! I do not yet know the method "hasProperty". As a short term work around, you may try directly: dtml-if navigation_name dtml-var navigation_name dtml-else dtml-var title_or_id /dtml-if This may acquire "navigation_name". Thus, you may restrict namespace lookup with: dtml-with sequence-item only -- code above-- /dtml-with Dieter ___ 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 )
[Zope] DTML Problem (from the newbie hair ripper category)
Greetings, I have created a custom Zclass called "Category." This object is based on the "objectManager" template. Essentially this object is a container with a few properties attached; "navigation_name" and "description." Essentially, the gist of this is to create a navigation menu with a dtml-in loop that displays all of the Category('s) in a given directory. However, I want the property "navigation_name" to show up as the hyperlink text. Does this make sense? So, if I simply call the dtml-in "objectValues(['Category'])" and then print the name with dtml-var navigation_name, everything works fine!! Here is the proverbial rub. If I want to *test* for the presence of "navigation_name" so I can print "title_or_id" if it's not defined, Zope simply skips the "navigation_name" property. It's like it always evaluates to false! Example for "left navigation" dtml method: dtml-in "objectValues(['Category'])" dtml-if "hasProperty('navigation_name')" dtml-var navigation_name dtml-else dtml-var title_or_id /dtml-if /dtml-in Okay, I think to myself "self, maybe acquisition is getting in the way," so I try: dtml-in "objectValues(['Category'])" dtml-with sequence-item dtml-if "hasProperty('navigation_name')" dtml-var navigation_name dtml-else dtml-var title_or_id /dtml-if /dtml-with /dtml-in Doesn't work! Could this have something to do with the definition of my own Zclass? Do I have to read into the property sheet specifically? Is there a command for that? I took the example from the excellent "Breadcrumb Navigation Trail Howto" and that works fine, as long as I use a supplied Zope object (like "folder"). As soon as I use my own ZClasses, this breaks. (I'd like to get my "navigation_name" into the breadcrumbs as well. Thanks in advance, -Darin Lee ___ 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 )