hi zopistas, here is a tricky one and i haven't come up with a good solution so far. i have a site which uses a common standard_html_header to display all site navigation links. what i want to do now is make the "help" link, which is part of the standard_html_header, context sensitive. for this purpose i somehow need to catch information within that header about what document it is currently being called for. i experimented with something like <!--#with REQUEST--><a href="help_<!--#var document_id-->_html">HelpLink</a><!--#/with--> to retrieve data from the REQUEST, but document_id still resolves to either standard_html_header or to the ID of the folder holding everything. anyone have any suggestions or done something similar? Jens Vagelpohl
Jens Vagelpohl wrote:
here is a tricky one and i haven't come up with a good solution so far. i have a site which uses a common standard_html_header to display all site navigation links. what i want to do now is make the "help" link, which is part of the standard_html_header, context sensitive. for this purpose i somehow need to catch information within that header about what document it is currently being called for.
depending on your setup, you could easily customize the help page on a per folder basis by linking to a help_html method, and placing one in each folder. If you have more than one content file per folder, you can attach a 'helpfile' string property to DTML methods holding content, and create a link like this: --untested code-- <a href="<!--#var helpfile-->">Help</a> HTH, Michael Bernstein.
hi michael, thanks for the hint. this works great on all DTML *documents*, but i have some DTML *methods* which render pages and those unfortunately don't have a "properties" tab where i could add such a variable. :( any ideas for (elegantly) adding my "helpID" variable so it will work in those page rendering methods as well? Jens Vagelpohl
-----Original Message----- From: Michael Bernstein [mailto:mbernstein@profitscape.net] Sent: Tuesday, July 13, 1999 14:56 To: Jens Vagelpohl Cc: zope@zope.org Subject: Re: [Zope] finding that variable...
Jens Vagelpohl wrote:
here is a tricky one and i haven't come up with a good solution so far. i have a site which uses a common standard_html_header to display all site navigation links. what i want to do now is make the "help" link, which is part of the standard_html_header, context sensitive. for this purpose i somehow need to catch information within that header about what document it is currently being called for.
depending on your setup, you could easily customize the help page on a per folder basis by linking to a help_html method, and placing one in each folder.
If you have more than one content file per folder, you can attach a 'helpfile' string property to DTML methods holding content, and create a link like this:
--untested code-- <a href="<!--#var helpfile-->">Help</a>
HTH,
Michael Bernstein.
Jens Vagelpohl wrote:
thanks for the hint. this works great on all DTML *documents*, but i have some DTML *methods* which render pages and those unfortunately don't have a "properties" tab where i could add such a variable. :(
any ideas for (elegantly) adding my "helpID" variable so it will work in those page rendering methods as well?
Well, do you have more than one DTML Method per Folder? if not, you can attach a 'helpfile' property to the folder, and the Method will acquire it, making it display exactly the same as the Documents do. HTH, Michael Bernstein.
hi mike & fellow zopistas, yes, i do indeed have more than one DTML method in the respective folder. i did start thinking about what i was doing (having a DTML method render the whole page) and i thought that this doesn't really make that much sense. so i created a dtml *document* which accesses that method. however, i ran into trouble passing the variables i need. passing variables from methods to documents and back and how exactly this is done syntactically and how, after passing them, i am supposed to refer to them in the right way is still a little voodoo to me. some things works great in one application, but in a seemingly similar situation it doesn't. maybe this would ge a great idea for a little Zope HOWTO, something to complement the documentation on the Zope website (hi pam! ;) here's some of my questions regarding passing of variables, please keep in mind that i am working in a setup with several methods and documents in a directory, obviously an easy way would be to make sure there is just one method per folder and to make the variables into folder properties: * how do i correctly pass variables from a *document* to another *document*? and is there an elegant way to avoid calling the document with the whole rat's tail of arguments attached (as in "a href="doc2?var1=x&var2=y&var3=z..." etc ad infinitum) * how do i correctly pass a variable into a DTML *method* from a *document*? * how do i correctly refer to a passed-in variable in *documents* and *methods*? * what is the real difference between calling a method via <!--#call "myMethod"--> and via <!--#var "MyMethod"--> and which of the two is the correct way to do it (especially when it comes to passing arguments in that call)? maybe my confusion comes from not having any python background... :( Jens Vagelpohl
-----Original Message----- From: Michael Bernstein [mailto:mbernstein@profitscape.net] Well, do you have more than one DTML Method per Folder? if not, you can attach a 'helpfile' property to the folder, and the Method will acquire it, making it display exactly the same as the Documents do.
HTH,
Michael Bernstein.
participants (2)
-
Jens Vagelpohl -
Michael Bernstein