Display parent container title in Page Template
Hi. In a Page Template, how can I display the title property of a parent container, in this case, a folder? For example: Title: <strong><span tal:content="result/title">Item Title</span></strong><br> Returns the title of the page template document, but I need to show the title property of the folder that contains it. Folder (My Folder's Title) |__ content.htm (a Page Template) Ultimately the parent folder would have a title property for each of several languages. Harlow Pinson Indepth Learning Email: hpinson@indepthl.com Web: http://www.indepthl.com Voice: 505-994-2135 FAX: 208-475-7678
In content.htm: <span tal:content="template/title">content.htm's title<span> <span tal:content="here/title">content.htm's parent container folder's title<span> <span tal:content="here/../title">content.htm's parent's parent's title<span> and so on... Babu http://vsbabu.org/ hpinson@indepthl.com wrote:
Hi. In a Page Template, how can I display the title property of a parent container, in this case, a folder?
For example:
Title: <strong><span tal:content="result/title">Item Title</span></strong><br>
Returns the title of the page template document, but I need to show the title property of the folder that contains it.
Folder (My Folder's Title) |__ content.htm (a Page Template)
Ultimately the parent folder would have a title property for each of several languages.
<span tal:content="here/../title"> works... but <span tal:content="result/../title"> does not work. Unfortunaly, I need to use the latter, since this is the results of a ZCatalog search and is dynamic. Thanks anyway. Harlow Pinson Indepth Learning Email: hpinson@indepthl.com Web: http://www.indepthl.com Voice: 505-994-2135 FAX: 208-475-7678
hpinson@indepthl.com wrote:
<span tal:content="here/../title">
works... but
<span tal:content="result/../title">
does not work. Unfortunaly, I need to use the latter, since this is the results of a ZCatalog search and is dynamic. Thanks anyway.
Is "result" a record returned by ZCatalog search? If so, it wouldn't work. It will work if result is the *actual* object corresponding to the record. If I understand correctly, you want to display the parent's title of the objects returned in a Catalog query. <div tal:repeat="result here/Catalog/searchResults"> <strong tal:define="obj python:here.Catalog.getobject(result.data_record_id_)"> <span tal:content="obj/../title">title of parent of record returned</span> </strong> </div> Babu http://vsbabu.org/
hpinson@indepthl.com wrote at 2003-8-18 13:36 -0600:
Hi. In a Page Template, how can I display the title property of a parent container, in this case, a folder?
For example:
Title: <strong><span tal:content="result/title">Item Title</span></strong><br>
Returns the title of the page template document, but I need to show the title property of the folder that contains it.
Folder (My Folder's Title) |__ content.htm (a Page Template)
Ultimately the parent folder would have a title property for each of several languages.
When you mean the folder containing the template, you can reference it as "container". Dieter
Get name of parent container in a page template. Hi Dieter, thanks-- we elegantly solved this in a thread yesterday.
In regards to another thread. I still have questions about using the filename property after a file upload, but am having trouble with the syntax in DTML ... recieving page of submitted HTML form file input: <!-- set a variable value for the attachment. <dtml-call "REQUEST.set('attachment_single',attachment_single)"> <!-- do upload. --> <dtml-call "manage_upload(attachment_single,action='manage_workspace')"> <!-- Show the value just assigned. --> <dtml-var attachment_single> This only shows the file reference. How do I call the filename? I've tried a bunch of things like: <dtml-var attachment_single.filename> To no avail... No obvious solution in the threads that I could find either, though lots of references to the filename property. Thanks for your continued support. Harlow Pinson Indepth Learning Email: hpinson@indepthl.com Web: http://www.indepthl.com Voice: 505-994-2135 FAX: 208-475-7678
This only shows the file reference. How do I call the filename? I've tried a bunch of things like:
<dtml-var attachment_single.filename>
To no avail... No obvious solution in the threads that I could find either, though lots of references to the filename property.
Try <dtml-var "attachment_single.filename"> (notice the quotes). jens
participants (4)
-
Dieter Maurer -
hpinson@indepthl.com -
Jens Vagelpohl -
Satheesh Babu